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

SVGLoader: properly handle missing y-value in translate transform #24395

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

nkrkv
Copy link
Contributor

@nkrkv nkrkv commented Jul 28, 2022

There’s a bug in SVG loader if an element uses translate(x) transform omitting the y value.

Here’s how an SVG renders in a browser:

image

The same in an app that uses SVGLoader (note the text offset):

image

After fix applied:

image

Root cause

The standard says:

If y is not provided, it is assumed to be 0.

But the current implementation sets it to be equal to x value which is incorrect.

@Mugen87 Mugen87 added this to the r144 milestone Jul 28, 2022
@mrdoob mrdoob merged commit ffd5c6b into mrdoob:dev Aug 2, 2022
@mrdoob
Copy link
Owner

mrdoob commented Aug 2, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
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.

3 participants