sw_engine shape: adding a dash pattern switch condition accepted/tizen/unified/20201102.124229 submit/tizen/20201101.231042
authorMira Grudzinska <m.grudzinska@samsung.com>
Mon, 26 Oct 2020 01:13:30 +0000 (02:13 +0100)
committerHermet Park <chuneon.park@samsung.com>
Mon, 26 Oct 2020 07:48:49 +0000 (16:48 +0900)
Preventing switching to the next dash pattern for a line with a length of zero.

Change-Id: I364a39cbf99f14d0a3563c65f7523c288fe97a6d

src/lib/sw_engine/tvgSwShape.cpp

index cb2d90e..a0cbce1 100644 (file)
@@ -268,7 +268,7 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
             _outlineMoveTo(*dash.outline, &cur.pt1, transform);
             _outlineLineTo(*dash.outline, &cur.pt2, transform);
         }
-        if (dash.curLen < 1) {
+        if (dash.curLen < 1 && TO_SWCOORD(len) > 1) {
             //move to next dash
             dash.curIdx = (dash.curIdx + 1) % dash.cnt;
             dash.curLen = dash.pattern[dash.curIdx];
@@ -314,7 +314,7 @@ static void _dashCubicTo(SwDashStroke& dash, const Point* ctrl1, const Point* ct
             _outlineMoveTo(*dash.outline, &cur.start, transform);
             _outlineCubicTo(*dash.outline, &cur.ctrl1, &cur.ctrl2, &cur.end, transform);
         }
-        if (dash.curLen < 1) {
+        if (dash.curLen < 1 && TO_SWCOORD(len) > 1) {
             //move to next dash
             dash.curIdx = (dash.curIdx + 1) % dash.cnt;
             dash.curLen = dash.pattern[dash.curIdx];