SVG-Edit / svgedit

Powerful SVG-Editor for your browser
MIT License
6.6k stars 1.54k forks source link

[Edition] Text Edition Bug. #958

Open louiesun opened 5 months ago

louiesun commented 5 months ago

Describe the bug Move the text to the left-bottom corner automaticly when editing some svg

To Reproduce Steps to reproduce the behavior:

  1. Open the given svg.
  2. Try to edit the text.
  3. See error. out-0001

Expected behavior Normal edition

SVG-Edit environment (IMPORTANT) The Latest PreView. And the same action. Try SVGEdit V7 (master branch on github) Try SVGEdit V7 (latest published version on npm)

Desktop (please complete the following information):

Screenshots The latest npm version. ss

Log If applicable, copy any error logs in your browser console. This can be very helpful in identifying the problem.

Additional context The svg is generated by MuPDF/PyMuPDF from a PDF file. Maybe the <tspan>

jfhenon commented 1 month ago

This is indeed a bug that seems to be linked to the

If you load this svg:

 <!-- Created with SVG-edit - https://github.com/SVG-Edit/svgedit-->
 <g class="layer">
  <title>Layer 1</title>
  <text id="svg_1" x="100" y="100">This is
   <tspan id="svg_2">a bug!</tspan></text>
 </g>
</svg>

You can move it using the arrow key or the mouse and it will create the bug

(jnterestingly, moving using the top bar x/y buttons seems to work normally)

A PR to fix this would be welcome.