Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy/drag SVG from local to drawio and its viewbox is modified #1686

Closed
2 tasks done
sunbigfly opened this issue Apr 9, 2024 · 2 comments
Closed
2 tasks done

Copy/drag SVG from local to drawio and its viewbox is modified #1686

sunbigfly opened this issue Apr 9, 2024 · 2 comments

Comments

@sunbigfly
Copy link

sunbigfly commented Apr 9, 2024

Preflight Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug
When I copy/drag and drop from local to drawio, the viewbox in the svg code is modified so that the picture is cut, but there is no problem when importing from local.

To Reproduce
Steps to reproduce the behavior:

  1. svg code:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   id="editable"
   width="150"
   height="150"
   preserveAspectRatio="xMidYMid slice"
   viewBox="0 0 150 150"
   version="1.1"
   sodipodi:docname="svg_1.svg"
   inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg">
  <defs
     id="defs1" />
  <sodipodi:namedview
     id="namedview1"
     pagecolor="#ffffff"
     bordercolor="#000000"
     borderopacity="0.25"
     inkscape:showpageshadow="2"
     inkscape:pageopacity="0.0"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1"
     inkscape:zoom="7.2466667"
     inkscape:cx="74.931003"
     inkscape:cy="75"
     inkscape:window-width="2160"
     inkscape:window-height="1360"
     inkscape:window-x="-11"
     inkscape:window-y="35"
     inkscape:window-maximized="1"
     inkscape:current-layer="editable" />
  <g
     id="cell">
    <path
       d="M36.38,24.05c2.62-3.59,4.55,.15,10.6,6.15,1.61,1.59,4.1,1.87,6.06,.75l1.29-.74c1.65-.94-7.34-24.75-.06-26.22,5.34-1.08,6.75,15.51,12.38,16.2,5.4,.66,5.29-8.06,9.65-10.72,3.25-1.98,19.5-4.07,22.9-1.24,5.64,4.69,.11,12.99,3.35,17.47,3.45,4.78,7.45,3.78,12.76,2.27,6.52-1.85,12.47-9.88,20.37-5.4h0c5.06,2.87,6.22,9.67,2.38,14.03-1.36,1.55-2.38,2.8-2.83,3.49-1.11,1.74,2.59,5.54,3.84,6.41,1.21,.85,4.6,6.46,4.48,11.85,0,.3-.05,.6-.11,.9l-.26,1.28c-1.05,5.05-7.24,8.34-8.03,12.91-1.1,6.33,9.86,10.04,8.86,16.04-2.35,14.12-16.74,5.79-23,12-6.31,6.26,10.89,15.34,8.58,25.23-.83,3.52-12.48-.85-13.78-.24-8.43,3.97-4.38-1.68-10.37,2.37-2.67,1.8,1.66,8.54-2.23,10.18-3.55,1.5-7.87-6.6-8.7-6.23-5.32,2.36-8.71,14.77-14.65,14.61-5.27-.14-14.04-23.23-19.28-21.47-6.72,2.26-1.07,21.81-12.23,19.33h0c-1.2-.27-2.26-.95-2.99-1.94-4.92-6.65-9.74-11.89-11.04-11.94-1.4-.06-4.17-4.12-4.04-6.37,.1-1.81-5.21-3.51-12.59-1.65-3.82,.96-7.88-.02-10.78-2.7h0c-2.9-13.18,12.19-10.45,10.9-14.43-2.14-6.6-13.44-.08-15.2-6.02-2.6-8.74,16.25-10.48,16.72-15.78,.68-7.7-8.9-9.53-4.67-18.12,3.34-6.79,14.74-2.02,17.46-11.72,3.11-11.11-12.7-16.15-14.85-24.96-1.16-4.73,12.55,3.46,19.13-5.57Z"
       fill="#afa9d9"
       stroke="#7b72b8"
       stroke-linecap="round"
       stroke-linejoin="round"
       stroke-width="2"
       id="path1" />
  </g>
</svg>
  1. copy/drag and drop from local to drawio.
  2. the picture is cut.

Expected behavior
I hope that when copying/dragging locally to drawio, the viewbox in the svg code will not be modified or cut.

Screenshots
original svg:
svg_1
Copied or dragged svg image:
Copied or dragged svg image

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 24.1.0

Desktop (please complete the following information):

  • OS: Windows
  • Google Chrome
  • Google Chrome Version: 123.0.6312.106 (official version) (64-bit)
@davidjgraph
Copy link
Contributor

Fix in 24.2.5.

@sunbigfly
Copy link
Author

Awesome, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants