sozi-projects / Sozi

A "zooming" presentation editor
http://sozi.baierouge.fr
Mozilla Public License 2.0
1.59k stars 165 forks source link

transforms always to the coordinate space of the document's viewport #649

Closed Gabba90 closed 2 years ago

Gabba90 commented 2 years ago

Hello.

This merge request should solve issues like https://github.com/sozi-projects/Sozi/issues/647. In fact, if the svgElement (e.g. an <image>) is a descendant of an inner <svg> element, svgElement.getCTM() returns a transformation matrix with respect to the viewport of the latter, while layerGroup.getCTM() provides one against the outermost <svg>'s viewport, leading to a unexpected transformations. By using getScreenCTM(), the returned matrix refers always to the document's viewport.