Jump to content

AD2.1.1: Scale transform incorrectly computed in presence of viewBox


purplie

Recommended Posts

Summary: An SVG file containing a group element with a simple "scale" transform causes a shape to be incorrectly placed.  The bug may be related to incorrectly using a coordinate system based on the viewBox.  

Application:  Affinity Designer 2.1.1

OS: MacOS 13.5

Reproducible: Yes.

Detail:

The attached SVG file describes two concentric circles, centered at (0,0), one red and the other blue.  

The file renders correctly in Inkscape, Safari, Chrome, and Intellij, thus:

image.thumb.png.0a16ff2259b42783addfe8bf53f62b62.png

But when opened in Affinity Designer, the blue circle is centered at (500,500) while the red circle is centered at (25000, 25000):

image.thumb.png.44de2a8048685919239b4e2372257a39.png

If the viewBox is deleted from the SVG file, the result is then correct. I suspect that the "transform" is being applied relative to the corner of the viewBox; but that is incorrect. Transforms apply in the "user coordinate system", not the viewBox coordinate system.

Here's a wild guess:  perhaps, in an effort to avoid showing unsightly negative coordinates in the UI, AD incorrectly handles the case of the viewBox having negative coordinates: it simply added a "translate(+500,+500)", and the scale() transform got applied after that.  But as you can see, that would be incorrect behavior.

bug-6.svg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.