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

Drag issues by missing width and height attributes in svg element #12

Open
HenkDemper opened this issue Nov 19, 2018 · 0 comments
Open

Comments

@HenkDemper
Copy link

HenkDemper commented Nov 19, 2018

Hello Douglas,

I like macSVG as it keeps the SVG XML structure intact when editing.
I ran across many existing icons with an issue.
At least partly where created in Adobe Illustrator.
Simplified one looks like:

<?xml version="1.0"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Test_1" style="enable-background:new 0 0 513.232 513.232;" version="1.1" viewBox="0 0 513.232 513.232" x="0px" y="0px" xml:space="preserve">
<path style="fill:#4CC6E5;" d="M380.2,340.88c0,95.184-77.168,172.352-172.352,172.352S35.496,436.08,35.496,340.88 S207.848,0,207.848,0S380.2,245.696,380.2,340.88z"/>
</svg>
  1. When I open it in macSVG it opens correctly, but as soon as I want to drag the path shape it moves out of sight. In inspecting another file that did work I noticed this one has no width or height attributes in the svg element. If I add those in a text editor like width="513px" height="513px" (using viewBox dimensions for test) then I can move the shape Ok.
    Should/could this be corrected in macSVG by using a width/height equal to the viewBox or perhaps the maximum shape dimensions if no width or height is specified ?

  2. The XML was formatted with a newline after the path element and before the closing . This results in macSVG showing a Text element with an empty value "", see screenshot. I know that elements can have text as element value between sub-elements, but shouldn't whitespace be filtered out when parsing an XML ? When there are many shapes there are an equal amount of empty text boxes, which is annoying/needless. When I save the SVG from macSVG the newlines are removed (formatting gone, but Ok) and immediately the empty text elements are gone...

text

  1. I was going to give a try to see if I could inspect(/fix ?) above 2 issues in the source code. However, running Xcode 9.4.1 and opening the workspace, it did not build directly. I needed to set 'Code Signing Identity' to 'Don't Code Sign for each and every (plugin) project within the workspace. After that I'm left with complaints with can't find MacSVGPlugin/MacSVGPlugin.h in some of the projects... I will noodle a bit further with search path, I guess I need to build MacSVGPlugin.framework first and there are some assumptions about the Products Build Locations...

I'm not sure how actively macSVG is maintained, but it would be great if you could react on above.

Thanks !

Henk Demper

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

1 participant