Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SVG coordinate parser that caused drawing artifacts #750

Closed
wants to merge 2 commits into from

Conversation

sslldavid
Copy link
Contributor

@sslldavid sslldavid commented Oct 4, 2024

Some SVG files are not correctly drawn because the coordinate parser treats consecutive float coords without zero like one coord. For example: .42 .61 2.50 translates to [0] = '.42.61' [1] = '2.50'. This fixes this cases.

Example of failing SVG: (it's the letter S):

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144.07 34.75"><path fill="#000" d="M124.72 15.04c-2.74 0-5.29-1.35-5.71-4.21-.12-.83.39-1.4 1.25-1.4 1.98 0 .49 3.38 4.53 3.38 1.47 0 2.96-.68 2.96-2.11 0-1.13-.73-1.64-1.91-1.81-2.72-.37-6.49-.59-6.49-4.36 0-2.99 2.92-4.46 5.36-4.46 1.74 0 3.58.51 4.6 2.06.42.61.88 2.03.07 2.62-.91.69-1.79 0-2.08-.76-.47-1.25-1.32-1.69-2.67-1.69-1.44 0-2.77.74-2.77 2.13 0 1.13 1.08 1.54 2.33 1.69 1.69.24 3.65.27 4.97 1.54.76.71 1.13 1.67 1.13 2.82 0 3.28-2.84 4.56-5.59 4.56" data-name="Capa_1"/></svg>

@CLAassistant
Copy link

CLAassistant commented Oct 7, 2024

CLA assistant check
All committers have signed the CLA.

@nicolaasuni
Copy link
Member

OK - Manually merged: #755

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants