Iām relatively new to Inkscape and Iām having trouble with the borders for a shape. This changed a fewdays\weeks ago and I canāt figure out what caused it. Iām running Inkscape 1.2.2 (732a01da63, 2022-12-09) on a win 10 machine first installed a few years ago and havenāt updated it recently. Iāve been searching forums, google, youtube, etc and canāt find anything.
I have a basic box showing a 1mm border. The borders change if I increase the box's height or width using the sizing arrows or the scale option. When the box height is changed, the top and bottom bars increase without the width, and when the width of the box is changed, the sides increase.
My example shows three boxes that were all the same size (bottom right) when they started, and you can see the stretched results.
It doesnāt matter if the āWhen scaling objects, scale the stroke width by the same proportionā button on the top toolbar is clicked or not. This happens to other shapes, but not to the noticeable extent of a box.
Probably your rectangle is inside a group. Possibly it's the only shape in the group. Look at the shape description in the taskbar. When you scale a group, the line widths are scaled too. Two solutions: Ungroup the shape [Object > Ugroup] or [shift+ctrl+g]. Or open the group with the select tool [double-click] or [ctrl+enter] or [right-click > Enter group] and then scale the shape.
Note that a group can contain subgroups. Your rectangle might be more than one level down in the hierarchy.
ThereĀ“s also a setting in the Inkscape Preferences->Behavior->Transforms->Store transformation: Optimized or Preserved. Check you have "Optimized" enabled.
Nope - it is an actual SVG bug. Most likely been in for a long time. Inkscape doesn't use the SVG vector-effect="non-scaling-stroke"Ā attribute. Not sure how they are going to be able to fix that easily.Ā
I've never had a problem with it because the Preferences prevent me from encountering. But we still canĀ“t be sure if this or the "Group-transform" is causing this here.
Correct - this only occurs when you set the transform behavior to preserved. If you set to optimized, you won't encounter this.Ā
Ā
When set to optimized, Inkscape willĀ appy calculations directly to the XML path data and the style width. When set to preserved, Inkscape lets the transform matrix handle the calculations and doesn't touch the actual XML pathĀ data and style. The problem comes in when you disable scaling the stroke width and have the behavior set to preserved. In this case, Inkscape should use "vector-effect="non-scaling-stroke"Ā attribute in the style.Ā
Looks like in the past, someone tried to address this issue and actually made the situationĀ worse by scaling the stroke width attribute in the XML directly when transform behavior was set to preserved. Basically a cludge fix.Ā You can see this in action if you do a stroke to path. The vertical lines are bigger and the horizontal lines are actually smaller.Ā
Iām relatively new to Inkscape and Iām having trouble with the borders for a shape. This changed a fewdays\weeks ago and I canāt figure out what caused it. Iām running Inkscape 1.2.2 (732a01da63, 2022-12-09) on a win 10 machine first installed a few years ago and havenāt updated it recently. Iāve been searching forums, google, youtube, etc and canāt find anything.
I have a basic box showing a 1mm border. The borders change if I increase the box's height or width using the sizing arrows or the scale option. When the box height is changed, the top and bottom bars increase without the width, and when the width of the box is changed, the sides increase.
My example shows three boxes that were all the same size (bottom right) when they started, and you can see the stretched results.
It doesnāt matter if the āWhen scaling objects, scale the stroke width by the same proportionā button on the top toolbar is clicked or not. This happens to other shapes, but not to the noticeable extent of a box.
Probably your rectangle is inside a group. Possibly it's the only shape in the group. Look at the shape description in the taskbar. When you scale a group, the line widths are scaled too. Two solutions: Ungroup the shape [Object > Ugroup] or [shift+ctrl+g]. Or open the group with the select tool [double-click] or [ctrl+enter] or [right-click > Enter group] and then scale the shape.
Note that a group can contain subgroups. Your rectangle might be more than one level down in the hierarchy.
ThereĀ“s also a setting in the Inkscape Preferences->Behavior->Transforms->Store transformation: Optimized or Preserved. Check you have "Optimized" enabled.
It's a bug.
https://gitlab.com/inkscape/inbox/-/issues/10896
Ā
So itĀ“s just a labelling error not a bug per se?
Nope - it is an actual SVG bug. Most likely been in for a long time. Inkscape doesn't use the SVG vector-effect="non-scaling-stroke"Ā attribute. Not sure how they are going to be able to fix that easily.Ā
I've never had a problem with it because the Preferences prevent me from encountering. But we still canĀ“t be sure if this or the "Group-transform" is causing this here.
Correct - this only occurs when you set the transform behavior to preserved. If you set to optimized, you won't encounter this.Ā
Ā
When set to optimized, Inkscape willĀ appy calculations directly to the XML path data and the style width. When set to preserved, Inkscape lets the transform matrix handle the calculations and doesn't touch the actual XML pathĀ data and style. The problem comes in when you disable scaling the stroke width and have the behavior set to preserved. In this case, Inkscape should use "vector-effect="non-scaling-stroke"Ā attribute in the style.Ā
Looks like in the past, someone tried to address this issue and actually made the situationĀ worse by scaling the stroke width attribute in the XML directly when transform behavior was set to preserved. Basically a cludge fix.Ā You can see this in action if you do a stroke to path. The vertical lines are bigger and the horizontal lines are actually smaller.Ā
Changing Preserved to OptimizedĀ worked!
Thanks everyone!