Rounding error?

General discussions about Inkscape.
elecman
Posts: 27
Joined: Mon Feb 09, 2015 1:39 pm

Rounding error?

Postby elecman » Mon Feb 09, 2015 1:48 pm

Why does a square show up in the SVG file as:
width="1023.46051"
height="1023.46051"
x="0.2697373629"
y="28.63189507"

Yet, the canvas size is 1024x1024, and the viewbox is 0 0 1024 1024, and document settings are in px.

I understand that the 28.6 is due to a transform, but the rest doesn't make sense.
Is this some sort of rounding error? I have the numeric precision set to 10 (min exp -10). Any way to fix this? It needs to be accurate because I use an XAML export (same problem) for a game.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Rounding error?

Postby tylerdurden » Tue Feb 10, 2015 2:10 am

do you have a stroke set on the object?

Check the attached file, and feel free to share yours.
Attachments
1024x1024.svg
(1.78 KiB) Downloaded 253 times
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

elecman
Posts: 27
Joined: Mon Feb 09, 2015 1:39 pm

Re: Rounding error?

Postby elecman » Tue Feb 10, 2015 2:43 pm

You are right, the stroke was the issue. Thanks so much!

I still wonder why it adds a transform though. Usually 0,-28.36
Any way to disable that or work around it?

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Rounding error?

Postby tylerdurden » Thu Feb 12, 2015 3:06 am

elecman wrote:I still wonder why it adds a transform though. Usually 0,-28.36
Any way to disable that or work around it?


I'd ensure the transforms in the preferences> behaviors are set to store as optimized.

If this will be used frequently, I'd also setup a custom template that can be used for each new document (Menu: File>Templates):
    delete layers
    set default units to px
    set page to 1024x1024
    include the rectangle object if it also will be used frequently and position to 0,0
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/


Return to “General Discussions”