common: add missing condition while trimming

The idea of introducing epsilon during trimming was to
eliminate the occurrence of short segments whose length
would be zero when higher computational accuracy was used.
By mistake, during the refactor of 8ed4c2f302,
one of the conditions was lost. Fixed.

@Issue: https://github.com/thorvg/thorvg/issues/3053
This commit is contained in:
Mira Grudzinska 2025-02-06 14:53:24 +01:00 committed by Hermet Park
parent 37c4ace685
commit d5125bd839

View file

@ -224,8 +224,8 @@ static void _trimPath(const PathCommand* inCmds, uint32_t inCmdsCnt, const Point
if (len + dLen > trimEnd) {
_trimAt(cmds, pts, moveTo, 0.0f, trimEnd - len, start, out);
start = true;
//add the whole segment
} else _add(cmds, pts, moveTo, start, out);
//add the whole segment
} else if (len + dLen > trimStart + EPSILON) _add(cmds, pts, moveTo, start, out);
}
len += dLen;