In Inkscape 1.2.2 on Windows 10 I'm tryint to create an SVG that completely starts off from px
measurements, and I'm trying to get the base measurements (widths, heights, stroke widths, etc) all in integer values.
Whatever I try, it keeps smudging tiny fractions from those integers in the .svg
file... Here's a repro:
- Create a new document...
- Document Properties, front page format "Custom" and in "px" measurements
- Width
120,000
and Height at50,000
(same for viewbox) - Scale at
1,000000
"px per user unit" - Display units set to
px
(same for Preferences > Interface > Grids, both kinds)
- Create a rectangle, and for example the most outer rectangle set to
- X:
0,000
- Y:
0,000
- W:
120,000
- H:
50,000
("px" in the dropdown right to it)
- X:
The first thing that's weird to me is that the "Stroke style" Width
is 1,999
px
, and if I set it to 2,000
then the X/Y/W/H values change for the worse. So for now I just fixate the X/Y/W/H and let the stroke width sit at a non-integer value.
- Save the document as an Inkscape .svg file
Result, relevant pieces:
<svg
width="120.00001"
height="50.000004"
viewBox="0 0 120.00001 50.000004"
I'm already confused now... 😮, and after a few bits of metadata the content is equally weird:
<g
inkscape:label="mylabel"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-97.913445,-31.265988)">
<rect
style="fill:none;stroke:#333333;stroke-width:1.999;stroke-dasharray:none"
id="rect8092"
width="118.00083"
height="48.000835"
x="98.913025"
y="32.265568"
inkscape:label="outerbox" />
</g>
That just really doesn't match my UI in Inkscape:
I understand that I'm working on a vector image, not a raster image. But surely I at least can get Inkscape to be precise in following my inputs in the UI?!
I suspect that I'm missing a key point here (is there some kind of scaling somewhere?!) and that this also relates to the Stroke style
width issue.
What am I missing!?