dsward2 / macSVG

macSVG - An open-source macOS app for designing HTML5 SVG (Scalable Vector Graphics) art and animation with a WebKit web view ➤➤➤
http://macsvg.org/
Other
1.18k stars 75 forks source link

Boxes, lines draw from strange origin points in specific document #4

Open mcclure opened 7 years ago

mcclure commented 7 years ago

Hello. I downloaded Version 1.0.1 (0656). I am using OS X 10.12.6 (16G29).

Steps: I download this specific SVG file https://github.com/VCVRack/Tutorial/raw/master/res/MyModule.svg from https://github.com/VCVRack/Tutorial

I select a tool, such as rectangle or line. I drag.

Expected behavior: A rectangle or line is drawn beginning at the point where I clicked down and ending at the point where I released the click.

Observed behavior: A rectangle or line is drawn beginning at a strange origin point far outside of the screen and ending at the point where I released the click. In addition, the "anchor" points for the object once drawn are bizarrely enormous. I do not see either of these strange effects when drawing in a document created in MacSVG using "New".

Screenshots:

In the first screenshot, I am hovering over the SVG with the rectangle tool. In the second screenshot, I have clicked and moved the cursor about one pixel.

rectangle screen shot 2017-10-19 at 12 11 03 am

Notes: I notice the svg is using a inkscape:zoom attribute on sodipodi:namedview and a transform attribute on the top-level <g>. Perhaps this is confusing MacSVG.

This project looks very promising.

dsward2 commented 7 years ago

mcclure - Thanks for your notes and test file. I'm preparing a new macSVG release (v 1.1), and running some tests with your file. It has been helpful in finding some bugs.

If you need to use tags in that document, the <svg> element needs an extra attribute - xmlns:xlink="http://www.w3.org/1999/xlink".

Currently, macSVG does not support editing of namespaces in the attributes table, but the "Edit XML Text" button does allow namespace attributes to be edited in the <svg> element. I'll add some code to add that attribute automatically in the next release.

thanks, Doug