sw_engine: fix a regression stroke bug

reverted changes that occurred this issue from d683d2e

Issue: https://github.com/thorvg/thorvg/issues/1670
This commit is contained in:
Hermet Park 2023-09-26 14:17:44 +09:00 committed by Hermet Park
parent 7ec969be29
commit e4ade98e8c

View file

@ -373,6 +373,10 @@ void _firstSubPath(SwStroke& stroke, SwFixed startAngle, SwFixed lineLength)
static void _lineTo(SwStroke& stroke, const SwPoint& to)
{
auto delta = to - stroke.center;
//a zero-length lineto is a no-op; avoid creating a spurious corner
if (delta.zero()) return;
//compute length of line
auto angle = mathAtan(delta);