Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Adapting Inkscape layers (When opening a file, the image is translated out of the canvas) #114

Closed
Zbatux opened this issue May 13, 2016 · 6 comments

Comments

@Zbatux
Copy link

Zbatux commented May 13, 2016

Hi,

When i open some svg files, like this one http://7ktw09.com1.z0.glb.clouddn.com/coastline.svg, the image is out of the editor canvas like in this screenshot http://img15.hostingpics.net/pics/665832bug.png. Am I the only one ?
I am trying to fix it but i don't know what to try first, any clues ?

@flintobrien
Copy link
Contributor

The SVG viewBox is set to -180, -85. Click on the top level group (double-click outside the canvas, then click the map). You will see the X and Y attributes at the top of the screen. Set both to 0.

See the red outline in the attached image.
svgeditscreenshot

@Zbatux
Copy link
Author

Zbatux commented May 17, 2016

Thanks for your help.

This works when the svg contains only one canvas. When i have an svg with multiple canvas, each canvas gets translated randomly. You can see the bug with this exemple http://imgh.us/speedometer.svg. Did you ever noticed something like that ?

@flintobrien
Copy link
Contributor

flintobrien commented May 17, 2016

I see what you mean. The linked svg file was originally created with Inkscape. Others can chime in, but my understanding is that Inkscape has a lot more features than svgedit and Inkscape files are not necessarily supported. While both produce standard SVG files, they don't have the same format for managing layers. That's why the whole drawing is converted to one layer in svgedit. A layer is just a top-level group element (ex: <g>...</g>). Create a new document in svgedit, add a second layer and look at the source to see the difference.

I was able to click on the various grouped objects and zero the x and y to fix the problem. You do have to click on a shape when there is no background rectangle to select. If you have a few files, you could do this by hand.

If there are many files, the best solution would be to translate the Inkscape layers to svgedit layers and zero each origin at the same time. You can develop this as an svgedit extension on file load or batch translate all files using XSLT. Maybe someone already has a translator, but I didn't find one with a quick internet search.

If some of your files are created with other programs, that's potentially more issues.

@codedread
Copy link
Member

I like the idea of extensions to translate files from other editors to SVG-edit!

@Zbatux
Copy link
Author

Zbatux commented May 19, 2016

Thank you for your explanation.
I have a lot of files ,I will try to develop a batch to translate them.

@brettz9
Copy link
Contributor

brettz9 commented May 31, 2018

An extension would be great...

@brettz9 brettz9 changed the title When opening a file, the image is translated out of the canvas Adapting Inkscape layers (When opening a file, the image is translated out of the canvas) May 31, 2018
@SVG-Edit SVG-Edit locked and limited conversation to collaborators Aug 31, 2021
@jfhenon jfhenon closed this as completed Aug 31, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

5 participants