mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-25 23:59:12 +00:00
sw_engine shape: adding a dash pattern switch condition
Preventing switching to the next dash pattern for a line with a length of zero.
This commit is contained in:
parent
4b58c5a5de
commit
34a832d033
1 changed files with 2 additions and 2 deletions
|
@ -268,7 +268,7 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
|
||||||
_outlineMoveTo(*dash.outline, &cur.pt1, transform);
|
_outlineMoveTo(*dash.outline, &cur.pt1, transform);
|
||||||
_outlineLineTo(*dash.outline, &cur.pt2, transform);
|
_outlineLineTo(*dash.outline, &cur.pt2, transform);
|
||||||
}
|
}
|
||||||
if (dash.curLen < 1) {
|
if (dash.curLen < 1 && TO_SWCOORD(len) > 1) {
|
||||||
//move to next dash
|
//move to next dash
|
||||||
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
||||||
dash.curLen = dash.pattern[dash.curIdx];
|
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);
|
_outlineMoveTo(*dash.outline, &cur.start, transform);
|
||||||
_outlineCubicTo(*dash.outline, &cur.ctrl1, &cur.ctrl2, &cur.end, 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
|
//move to next dash
|
||||||
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
||||||
dash.curLen = dash.pattern[dash.curIdx];
|
dash.curLen = dash.pattern[dash.curIdx];
|
||||||
|
|
Loading…
Add table
Reference in a new issue