Skip to content

Conversation

@KTibow
Copy link
Contributor

@KTibow KTibow commented Jul 10, 2025

it turns out in the past i used item.coords (post-instruction coordinate in ORIGINAL svg) (resulting in incorrect calculations) when i should've been using relSubpoint; this switches to relSubpoint when fitting.

closes #2093

@KTibow
Copy link
Contributor Author

KTibow commented Jul 11, 2025

the failing test cases are things like

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
<path d="M 78.301922,39.376734 L 64.971121,61.742246 L 73.061784,64.348229 L 78.512656,70.6691 L 84.285326,65.033743 L 92.451569,61.727261 L 78.301922,39.376734 z" fill="none" stroke="black" stroke-width="2"/>
</svg>

and the fail is because SVGO incorrectly rounds in a way that makes the start and end no longer connected

and the incorrectly coded "convert going home to z" logic was the only thing stopping the failure from surfacing

so fixing one thing shows another broken thing causes regressions... oh well i'll make a fix

@KTibow KTibow changed the title .coords is bad actually fix(convertPathData): use relSubpoint, not .coords Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The path minifier plugin isn't properly handling accumulated error

1 participant