sw_engine: fix dashing

Fixing the problem with handling a specific
case where the length of the remaining line
to be drawn and the dash line length were
exactly the same
This commit is contained in:
Mira Grudzinska 2024-06-01 15:40:32 +02:00 committed by Hermet Park
parent 185836d278
commit ec10e92362

View file

@ -107,7 +107,7 @@ static void _dashLineTo(SwDashStroke& dash, const Point* to, const Matrix* trans
if (mathZero(len)) { if (mathZero(len)) {
_outlineMoveTo(*dash.outline, &dash.ptCur, transform); _outlineMoveTo(*dash.outline, &dash.ptCur, transform);
//draw the current line fully //draw the current line fully
} else if (len < dash.curLen) { } else if (len <= dash.curLen) {
dash.curLen -= len; dash.curLen -= len;
if (!dash.curOpGap) { if (!dash.curOpGap) {
if (dash.move) { if (dash.move) {
@ -168,7 +168,7 @@ static void _dashCubicTo(SwDashStroke& dash, const Point* ctrl1, const Point* ct
//draw the current line fully //draw the current line fully
if (mathZero(len)) { if (mathZero(len)) {
_outlineMoveTo(*dash.outline, &dash.ptCur, transform); _outlineMoveTo(*dash.outline, &dash.ptCur, transform);
} else if (len < dash.curLen) { } else if (len <= dash.curLen) {
dash.curLen -= len; dash.curLen -= len;
if (!dash.curOpGap) { if (!dash.curOpGap) {
if (dash.move) { if (dash.move) {