Jump to content
kedmans

Exported to SVG path instead of a rectangle

Recommended Posts

Hi,

Attached two files. In one exported all right, because elementry redrew, while in the second file is exported as a path. Previously, there was a problem with opacity, or something else, now everything seems to have checked, but are exported anyway wrong.
tell me what the problem is and how it can be solved without re-drawing elements

riga1.afdesign

riga2.afdesign

Share this post


Link to post
Share on other sites

I also found another bug. Basically I cut a piece of the background and the program displays all right, but when I export to SVG - not displayed correctly. Stroke on the perimeter of the part is there, but the background color and shading remains.

From affinity:

M1256.01,1191L7.00869,1191L7.00869,7L932.009,7L932.009,481L1259.01,481C1259.01,481 1258.95,591.94 1259.01,592C1321.95,655.693 1337.6,790.798 1335.01,821C1334.09,916.749 1305.16,992.521 1256.01,1055L1256.01,1191ZM251.009,710L690.009,710L690.009,927L251.009,927L251.009,710Z

From another program (that's right)

M932.009,7 L932.009,481 L1259.01,481 C1259.01,481 1258.95,591.94 1259.01,592 C1321.95,655.693 1337.6,790.798 1335.01,821 C1334.09,916.749 1305.16,992.521 1256.01,1055 L1256.01,1191 L7.009,1191 L7.009,7 L932.009,7 z M690,710 L251,710 L251,927 L690,927 L690,710 z

Share this post


Link to post
Share on other sites

Hi Kedmans,

 

I've been trying to look into this... Do you mind me asking how you created the curves labelled '7' and '8'? Are they just copies of existing curves that have been translated? Have they been resized at all?

 

I'm just trying to get some ideas about what's happening :)

 

Thanks,

Matt

Share this post


Link to post
Share on other sites

Hi MattP,

 

It was created a long time ago. Each object was drawn separately. Yes elements from 1 to 8. And so I found only in the old file, which had to be changed. New versions of this problem has not yet been met.

 

Thanks,

KedMans

Share this post


Link to post
Share on other sites

Okay, thanks for that :)  If you ever manage to reproduce it, would you let me know? I can't (at present) come up with a good explanation for what's happening, but if you ever experience it again then maybe there will be some extra clues we could work out?

 

Thanks again,

Matt

Share this post


Link to post
Share on other sites

Okay, thanks for that :)  If you ever manage to reproduce it, would you let me know? I can't (at present) come up with a good explanation for what's happening, but if you ever experience it again then maybe there will be some extra clues we could work out?

 

Thanks again,

Matt

 

 

This may occur when a large object is cut into small with a tool "divide"?

Share this post


Link to post
Share on other sites

I still can't reproduce this... Even when I make shapes by boolean ops intersecting against rectangles then the output I get comes out as a <rect> tag when it should, and a path at other times. Have you been able to reproduce it?

Share this post


Link to post
Share on other sites

I still can't reproduce this... Even when I make shapes by boolean ops intersecting against rectangles then the output I get comes out as a <rect> tag when it should, and a path at other times. Have you been able to reproduce it?

 
Yes of course.
I took a little video.

 

The truth can not be attached videos here, had to share on the server.

 

http://kedmans.com/ad.mp4

Share this post


Link to post
Share on other sites

Thanks for that! I'd been trying with Intersection and just couldn't get it to go wrong - but you've clearly shown it going wrong with Divide... Does it go wrong every time for you? - I just still cannot get it to go wrong no matter what I do and I've tried drawing exactly the same thing as you about a dozen times and it always writes the <rect> tag! (I've tried the App Store version and the Beta version!)

 

Irrespective, I can now see how you've created it and will try to find the problem.

 

Thanks again,

Matt

Share this post


Link to post
Share on other sites

Fixed :)  That will be available in next week's beta. Thanks again for all your help! :)

 

I found another mistake.

I paint objects and coordinates with no fractional part. I do not use the field, but when exporting objects get a fractional part, for example, 819.003 instead of 819 or 1115.96 instead of 1116
 
 
<rect xmlns="http://www.w3.org/2000/svg" x="1115.96" y="465.003" width="121" height="351" style="fill:rgb(78,78,78);fill-rule:nonzero;"/>

<rect xmlns="http://www.w3.org/2000/svg" x="165.955" y="963.003" width="136" height="61" style="fill:rgb(78,78,78);"/>

Share this post


Link to post
Share on other sites

I'll obviously take a look at that too, but it's confusing because those numbers are not small differences... The width and height are exact, so I'd expect the position to be exact too.

 

Here's what I get from my quick test:

<rect x="206" y="194" width="200" height="141" style="fill:rgb(235,235,235);"/>

The beta is always available from the pinned thread at the top of the beta forum. At present, this beta does not contain your fix yet, but it will be updated early next week and your issue will be fixed

 

Thanks,

Matt

Share this post


Link to post
Share on other sites

I'll obviously take a look at that too, but it's confusing because those numbers are not small differences... The width and height are exact, so I'd expect the position to be exact too.

 

Here's what I get from my quick test:

<rect x="206" y="194" width="200" height="141" style="fill:rgb(235,235,235);"/>

The beta is always available from the pinned thread at the top of the beta forum. At present, this beta does not contain your fix yet, but it will be updated early next week and your issue will be fixed

 

Thanks,

Matt

 
I agree about the accuracy of that difference is too small. It's just different - I share the SVG version of objects and paste to your site. Subsequent plug if the number is not an integer - adds a significant fractional part and it significantly increases the amount of traffic, in which there is no need, therefore, have to hand all integers not turned into a whole and it is a bit inconvenient.
 

 

And noticed a bug with the fact that iCloud Drive if you just go in there Affinity Designer can not create additional folders, and then if you go through the web or with iCloud Drive - Folder program is not visible.

Share this post


Link to post
Share on other sites

I think that bug is still not completely solved. Actually Affinity Designer exports a rectangle now as <rect ...>

But this is only if it's an "untouched" rectangle. Not supported are strokes and especially rounded corners.

Strokes will always be exported as a path and as soon as you add a rounded corner, it will completely exports as a path... a much too complicated path.

This problem of the rounded corners produces horrible files, but just see the attached examples. You will see the problems, if you reimport the svg file (and you can see at the .afdesign file, that the icon was made right)

files.afdesign

filesRight.svg

filesWrong.svg

Share this post


Link to post
Share on other sites

Hi Lupurus,

SVG don't have support for inside/outside stroke alignments, so to preserve accuracy we expand strokes on output.

Regarding the stroke on your file, it's being expanded because you have set the stroke alignment to inside. Change the alignment to Centre and it will export as a stroke rather than an expanded path.

 

Share this post


Link to post
Share on other sites

Ah wow, centering the stroke works perfect! Thanks! I always made it to inside so that it's easier to snap it to the sides of the document. Maybe you could change the magnetic alignment (sorry I don't have the right translation, in German it's the "Magnetische Ausrichtung"), so that it will snap to the stroke and not to the rectangle itself.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.