W3C home > Mailing lists > Public > www-svg@w3.org > November 2020

Re: "transform" applied to <svg> element in SVG 2

From: Stephan Mühlstrasser <stm@pdflib.com>
Date: Fri, 13 Nov 2020 09:14:27 +0100
To: www-svg@w3.org
Message-ID: <b3e8a304-855f-48ee-0269-d11504794f00@pdflib.com>
> Are the browsers correct to use the center of the image as origin for 
> rotation and scaling for case "A"? If the browsers are correct, where is 
> this defined in the SVG 2 specification?
> 
> I read https://www.w3.org/TR/SVG2/coords.html#TransformProperty "8.5. 
> The ‘transform’ property" and 
> https://www.w3.org/TR/SVG2/coords.html#ViewBoxAttribute "8.6. The 
> ‘viewBox’ attribute", but I could not understand how itwould explain 
> the behavior I'm seeing.

I think I found the reason now in CSS with the "transform-origin" property:

https://drafts.csswg.org/css-transforms/#transform-origin-property

For the top-level <svg> element the default is "50% 50%", which explains 
that the origin for scaling and rotating is in the center of the image.

-- 
Stephan
Received on Friday, 13 November 2020 08:14:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 13 November 2020 08:14:45 UTC