Change the stroke width without changing the width and height of the rectangle


When I change the stroke width of a rectangle the width and and height change also. How can I prevent this from happening?

12/31/2014 1:54:00 PM

In my opinion, "width of a rectangle" in your question can mean two things, leading to two different answers; it is not clear for me which one you actually ask for. Which one do you want to have constant:

  1. The visual size of the rectangle, i.e. from the outer line edge left to the outer line edge right.
  2. The nominal (geometric) size of the rectangle, i.e., from the center of the left line to the center of the right line.

You might rather care for (1) if you do graphic design and for (2) if you do technical drawings. Inkscape by default seems to show (1) as the width of an object (e.g., in the "W:" field in the toolbar). The answers already given here indicate on how to keep this visual size (1) constant.

However, if you are actually interested in (2), Inkscape can also to show this as the width. For this, go to Preferences -> Tools and set "Bounding box to use" to "Geometric bounding box" instead of "Visual bounding box". Now the geometric size (2) will be indicated by Inkscape. You can now change the line width as you like, and the indicated rectangle width is not affected.

1/9/2016 2:23:00 PM