0

In my svg, I've made sure I have no transform on any nodes on the way to my rect:

  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <g
       id="my_group">
    ...
      <rect
         style="display:inline;fill:none;stroke:#000000;stroke-width:0.5;stop-color:#000000"
         id="my_rect"
         width="40"
         height="13"
         x="0"
         y="0"
         ry="1.5" />
    ...

... and yet, when I open this in Inkscape 1.2 and select the rect, I get this shown:

Inkscape

That is, for a rect with x="0" y="0" width="40" height="13" style="...stroke-width:0.5;..." ... in SVG, I get "X=-0.250 Y=-0.250 W: 40.500 H: 13.500" shown as info in Ikscape when I click on the same rect.

Is this a standard/unchanging behavior of Inkscape: that whatever the settings in the SVG, ultimately Inkscape will show (svg width + stroke width) for W, (svg height + stroke width) for H, (svg x - stroke width/2) for X and (svg y - stroke width/2) for Y - at least for objects that can be stroked, like rect? ( I guess, in this case, svg x,y define the upper left corner of the rect including the stroke; Inkscape X,Y is the upper left corner of the "virtual rectangle" which then gets stroked afterwards (half stroke width outside, half stroke width inside )

Or is it controllable by some switch in Inkscape?

2
  • 2
    Check out one of my older answers here. Basically, set 'Bounding box to use' to 'Geometric' in the preferences to make Inkscape ignore things like stroke-width.
    – Xrott
    Commented Jul 6, 2023 at 14:42
  • Thanks @Xrott - that explains it
    – sdbbs
    Commented Jul 6, 2023 at 15:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.