-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Different transform results than browser #113
Comments
Can you check the bounding box in both versions? I have the gut feeling that it is wrong on svgdom |
Hmm so the bbox before the transform on both is:
After the transform the browser bbox is unchanged but the svgdom becomes:
What is happening here? |
The bbox should have some dimension before transformation. Can you give me the code of the svg? Without a bbox, the element is either not in the Dom or doesn't have any dimensions. In both cases its kinda pointless to transform the element. |
I believe the issue resides in the font loading. On my browser I create the svg element and set the text to an empty string using |
I haven't quite pinpointed where issue is and unfortunately my codebase is way to complex to use as an example but the gist of what is happening is that the order in which I add elements matters on svgdom as far as transforms. Mock example
Basically I set an initial rectangle box in which I write text. I set the initial transforms to be relative to that box and on browser it does not matter what order I do the plain() calls in. But on svgdom the second call seems to use the first one to affect its position. So in my initial transform on browser - bar is sitting at bottom of rectangle but on svgdom its sitting at bottom of the foo bbox. |
That is wild. Without reproduction this is really hard to pin down. I assume your mock example doesnt have that issue, right? |
I am migrating a complex browser based SVG generator to use SVGDOM and have it working 99%. There is one spot however where the transform calculations are different and wondering if you think it might be a bug or if there is something I am missing.
I have an element and applying the following action:[]
The "coordinates" data before the transform is the same but the result is different - For ex notice the "f" and "translateY" parameters.
Browser:
Before transform:
After:
SVGDom:
Before transform:
After transform:
I have tried this with 0.1.14 as well as current master with same result.
Happy to provide additional data. Do you have an idea what issue could be?
The text was updated successfully, but these errors were encountered: