Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

  • Staff

Hi GokhanEser,

Please could you copy the object in-question to a new file then save a copy of that file and attach it to this post so I can investigate this further.

Thanks

C

Please tag me using @ in your reply so I can be sure to respond ASAP.

Link to comment
Share on other sites

On 1/17/2021 at 12:15 PM, GokhanEser said:

There is a margin in svg files.

Check the SVG file inside a webbrowser and text editor too, in order to see how much of the SVG defined overall margins size amount differs from the plain objects size settings inside here.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

That looks to me due to Affinity document size and thus dependent SVG viewBox value rounding issue here. A SVG viewBox uses full pixel values (whole integer numbers and no real numbers). When exporting Affinity usually rounds up or down the document (SVG viewBox) size values, but in a way the objects still fits sizewise inside those boundaries.

In your case it looks like this ...

rounding_bug1.jpg.7a01826b03765b85f9bfdc25db6f0441.jpg

rounding_bug2.jpg.cef940c0a7adb7b5e0d1c6893e6604d0.jpg

So Affinity here defines whole pixel values for the exported SVG, meaning even the objects (curves) size in w/h will be correct w = 53.1 px, h =10.2 px it has to make the SVG viewBox values as whole number pixels (width = 54, height = 11), so the object fits inside at all.

So what can you do in order to have not those margin gaps is, best use whole number (whole pixels) in Affinity for doc and curve sizes here instead of real numbers, when you know a drawing will be exported as SVG. - Or you have to alter the SVG viewbox settings inside a text editor to overcome the margin gaps, as far as the objects size dimension still fits completely inside then.

Just for demonstration purposes here, if I alter the doc settings in SVG to viewBox="0 0 53 10" then of course the margin gaps will disappear ...

curve_sized_doc.jpg.e0f274948e0f36fc60cf4c8bbfcbefd0.jpg

... but as you can see the object (curve) then doesn't fit completely into the docs area, it will stay 0.1 px over in width and 0.2 px in heigh! - You can see it here with these files yourself ...

So the best is always to take into account here for SVG when exporting, that it defines it's viewBox (aka doc boundaries) as whole numbers and thus that there might be then size roundings involved, which might give some gaps/margins!

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | 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.