mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 11:36:25 +00:00
sw_engine/shape: fix a dash-line infite-loop bug.
a regresion bug was introduced by d683d2e70d
This commit is contained in:
parent
bd9d0cea6d
commit
edb156f4fc
1 changed files with 2 additions and 2 deletions
|
@ -129,8 +129,7 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
|
||||||
Line left, right;
|
Line left, right;
|
||||||
if (dash.curLen > 0) {
|
if (dash.curLen > 0) {
|
||||||
len -= dash.curLen;
|
len -= dash.curLen;
|
||||||
_lineSplitAt(cur, dash.curLen, left, right);;
|
_lineSplitAt(cur, dash.curLen, left, right);
|
||||||
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
|
||||||
if (!dash.curOpGap) {
|
if (!dash.curOpGap) {
|
||||||
_outlineMoveTo(*dash.outline, &left.pt1, transform);
|
_outlineMoveTo(*dash.outline, &left.pt1, transform);
|
||||||
_outlineLineTo(*dash.outline, &left.pt2, transform);
|
_outlineLineTo(*dash.outline, &left.pt2, transform);
|
||||||
|
@ -138,6 +137,7 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
|
||||||
} else {
|
} else {
|
||||||
right = cur;
|
right = cur;
|
||||||
}
|
}
|
||||||
|
dash.curIdx = (dash.curIdx + 1) % dash.cnt;
|
||||||
dash.curLen = dash.pattern[dash.curIdx];
|
dash.curLen = dash.pattern[dash.curIdx];
|
||||||
dash.curOpGap = !dash.curOpGap;
|
dash.curOpGap = !dash.curOpGap;
|
||||||
cur = right;
|
cur = right;
|
||||||
|
|
Loading…
Add table
Reference in a new issue