From 5aed123ef700c79c26b4597ebda4cc62b621f2be Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Tue, 3 Nov 2020 11:22:18 +0900 Subject: [PATCH] rlottie: draw line if width or height is 0 If width or heigth is 0 rlottie returned without drawing rect. But it makes sense to draw line even if width or height is 0. --- src/vector/vpath.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/vpath.cpp b/src/vector/vpath.cpp index f0dbec8..d49cd00 100644 --- a/src/vector/vpath.cpp +++ b/src/vector/vpath.cpp @@ -219,13 +219,13 @@ void VPath::VPathData::addOval(const VRectF &rect, VPath::Direction dir) void VPath::VPathData::addRect(const VRectF &rect, VPath::Direction dir) { - if (rect.empty()) return; - float x = rect.x(); float y = rect.y(); float w = rect.width(); float h = rect.height(); + if (vCompare(w, 0.f) && vCompare(h, 0.f)) return; + reserve(5, 6); // 1Move + 4Line + 1Close if (dir == VPath::Direction::CW) { moveTo(x + w, y); -- 2.34.1