Closed xiejia1995 closed 3 years ago
another example
this corresponds to issue #69 which was solved some times earlier, but the issue seems to have re-appeared.
I was able to reproduce the issue. The center point of a shape is repositioned slightly. To be more precise the translate portions of the transform matrix of the surrounding svg group element
(: created and saved :)
<g transform="matrix(1 0 0 1 1491.8 1581.67)" id="s-16288690858605">
<polygon points="-189.46,-220.69 191.66,-208.45 200.1,220.69 -200.11,216.84 "/>
</g>,
(: selected and saved :)
<g transform="matrix(1 0 0 1 1493.8 1583.67)" id="s-16288690858605">
<polygon points="-189.46,-220.69 191.66,-208.45 200.1,220.69 -200.11,216.84 "/>
</g>,
(: repositioned and saved again :)
<g transform="matrix(1 0 0 1 1491.98 1581.85)" id="s-16288690858605">
<polygon points="-189.46,-220.69 191.66,-208.45 200.1,220.69 -200.11,216.84 "/>
</g>
That is circa 2 pixels added for both x- and y-coordinates when a shape is selected by clicking on it and not moved. When the box is moved then the correct center is returned when the shape is serialised.
That is a strong hint at:
shape-changed
event on selection must be avoided as this will offset a shapes center
see screenshots. Taking the example of Jb_0330_1921-12-06_0002+0003, many boxes are found to have moved a little automatically to the right and down after editing.
I took the first screenshot right after saving my edits on June 11, and took the second one three days later, to find that boxes did move.