Inkscape.org
Beginners' Questions How to make Stroke entirely margin or entirely padding?
  1. #1
    Richard JE Cooke Richard JE Cooke @richard.j.e.cooke
    *

    If I make a rectangle with size (10,10) with fill but no stroke it's correctly placed and sized.

    But if I add a 2px stroke Inkscape indents the start of the rectangle right 1px (making the fill size smaller) as if the stroke is acting like HTML padding, but Inkscape ALSO starts the stroke 1px up and left (making the total object size bigger) as if the stroke is acting like HTML margin.

    This makes any precision work incredibly difficult, because I keep having to predict the average of my stroke size changing my object position AND size every time and recalculate all my boxes.

    Is there a way to make stroke act either as margin or as padding but not this horrible mixture of both that breaks all my box models please?

  2. #2
    Polygon Polygon @Polygon🌶

    Inkscape operates with 2 different bounding boxes: Geometric for the stoke and Visual bounding box including stroke width - I guess you need the latter which you can adjust in Inkscape Preferences->Tools

  3. #3
    Richard JE Cooke Richard JE Cooke @richard.j.e.cooke

    That's purely decorative - it just changes the list selection indicator in Inkscape - it doesn't affect the box model of the object at all.

  4. #4
    Polygon Polygon @Polygon🌶

    It will when it updates: what´s a 40x40mm rectangle plus 1mm Stroke width will become a 41x41mm rectangle when Visual bounding box is checked on - so it needs H+W adjusted to fit 40x40mm again. Unless I misunderstood your goal.

  5. #5
    Richard JE Cooke Richard JE Cooke @richard.j.e.cooke

    No, here look, even with Visual bounding box on (the default anyway) if I add a stroke to an object it changes BOTH the total size AND the start location.

    If it just changed the fill area (inner padding) then I could simply make each object bigger by a known amount, or if it just changed the location (outer margin) then I could reposition each object and know the size would be fine. But now I have to change both settings, each by half the stroke width. This is crazy.

  6. #6
    Aero Aero @Aero◻️

    Hide half the stroke behind the fill maybe?

  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    I would probably not use a stroke and use View>Display mode>Outline. Are we creating cutting vectors?

  8. #8
    Richard JE Cooke Richard JE Cooke @richard.j.e.cooke
    👍

    Thank you @Aero, changing the order to Fill second allows me to see the complete fill area with size unchanged (like the Stroke is only margin). Of course I must always remember the stroke is half the width I type in, but that's fine.

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How to make Stroke entirely margin or entirely padding?