Open w8w8w8 opened 1 month ago
I think it is an issue with the "symbol" tag. Can you make a very simple SVG in which the problem occurs?
such as this one:
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Created with SVG-edit - https://github.com/SVG-Edit/svgedit-->
<defs>
<symbol id="svg243_76" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<rect fill="#FF0000" height="500" id="svg_1" stroke-width="5" width="500" x="0" y="0"/>
</symbol>
</defs>
<g class="layer">
<title>Layer 1</title>
<use id="svg243_77" transform="rotate(-90 200 200) matrix(0.1 0 0 0.1 0 0)" x="200" xlink:href="#svg243_76" y="200"/>
</g>
</svg>
I could find a quite simple shape on which the bug occurs. I also tested that this bug unfortunately is also with older version of svgedit (I tested with 5.1 and 3.2).
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<!-- Created with SVG-edit - https://github.com/SVG-Edit/svgedit-->
<g class="layer">
<title>Layer 1</title>
<rect fill="#FF0000" height="50" id="svg_2" stroke-width="5" transform="rotate(-45) matrix(0.1 0 0 1 0 0)" width="50" x="100" y="100"/>
</g>
</svg>
I believe this is an issue in svgcanvas in the function recalculateDimensions() of recalculate.js
May not be very easy to fix...all PRs on this subject are very welcome..
Load the svg file ,and click some element , the select element postion error
the svg file :
![243](https://github.com/SVG-Edit/svgedit/assets/4744039/648f1aa2-3812-41ca-9f44-53c3e56fbd07)