โ I'm on Windows 10, German edition, and on Inkscape Inkscape 1.2 (dc2aedaf03, 2022-05-15).
โ I've got a document containing a path atop a rectangle, both having an equal stroke width of 5 px.
โ I've unset the preferences option to scale stroke width.
โ I've unset the icon in the top right corner with the tooltip, โWhen scaling objects, scale the stroke width by the same proportionโ.
โ I select both objects and transform the width, not the height.
See 1st screenshot, highlighting in purple just what I did.
I was hoping that the stroke width should remain at 5 px after the transformation, just as I specified. But instead, the transformation does affect the stroke width; it is now far thicker than 5 px at the top and bottom and far thinner than 5 px at the sides. This pertains to the pure path (top) as well as to the rectangle (bottom).
So how do I stop this annoying effect? Extensive googling hasn't turned up an answer, besides turning off the two options that I did turn off.
You can also do this without ungrouping. [double-click] or [ctrl+return] to enter the group. Select all [ctrl+a]. Now you can stretch your shapes, preserving the stroke thickness. [ctrl+backspace] to leave the group.
In the original experiment above, I selected the two objects together, I didn't group them. But, fair enough:
I'm repeating the experiment using just 1 object, a path with 3 nodes. Shrinking the path horizontally but not vertically still repeats the effect that the stroke width is scaled, and scaled unevenly.
It seems that your second constellation shows the effect I was talking about: The stroke thickness in the horizontal portions of the stroke is bigger than the thickness in the vertical portions. The third constellation is different: Now the strokes have uniform thickness. What did you do to get from #2 to #3?
In my comment #3 above, the centre shapes are a group of two objects. Scaling svg groups stretches stokes and fills alike. The shapes on the right are not grouped so stroke widths were preserved. This is the expected behaviour.
I opened your svg attachment and used the Select tool [s] to stretch the shapes. Stroke thickness was preserved. I see thinning and thickening of strokes while dragging the selection handle, but it reverts to the original stroke width when I release the mouse button.
The XML Editor shows transforms applied to your shapes so I went to Inkscape Preferences then [Behaviour > Transforms > Scale stroke width]. This changed from no thickening to uniform thickening, but not the uneven thickening in your screenshots.
I'm at a loss. I can't explain your experience. What happens if you use the node tool [n] and [ctrl+drag] to scale the shapes?
So, here's an all new document (attached, uneven-stroke0.svg).
The first pic (attached, 5a) shows all of the XML of the document and the attributes of the node with id layer1: Layer 1 does not have any matrix transformation.
The second pic (attached, 5b) shows the attributes for the node with id rect1090: The rectangle does not have anx matrix transformation
As before, I now shrink the rectangle horizontally but not vertically โ by grabbing the middle right handle โโโ and moving it to the left.
Now, I get the situation in the third pic (attached, 5c): Distorted stroke. Now the rectangle does have a transformation, but that's kind of the point of the horizontal but not vertical shrinking.
The fourth pic (attached, 5d) shows that the layer, however, still does not have any transformation.
Iยดm not able to recreate this following your steps. Are you really sure youยดre not scaling the Layer instead of the rectangle by accident? Once you scaled the Layer all objects will have a transform matrix unless you delete it in XML editor.
I'm now including a film (window capture) that shows exactly what I'm doing, in file 2023-10-28_18-30-50.mp4. I've saved the document immediately before that (uneven-stroke0.svg) and immediately afterwards (uneven-stroke1.svg)
I've opened both files in Notepad++ and had it compare them to each other, and I can't see any transformation to the group <g โฆ id="layer1"> that might have been added by my handling. Differences would be highlighted in the screenshot uneven_stroke6.png. In the "before" document uneven-stroke0.svg, the group does not have a transformation, as also shown in the screenshot.
The result is in the screenshot uneven-stroke6.png, attached, showing the stroke distortion. Even when I close Inkscape completely and re-open it with uneven-stroke1.svg, it shows the distortion (shown in screenshot uneven-stroke6.png).
Note that I'm transforming the rectangle, not the triangle, which both are children of the layer. If I was transforming the layer, wouldn't both the triangle and the rectangle be affected?
I still donยดt get how you introduce the transform matrix just by scaling the object horizontally. This is how your file works here. Notice that Iยดm deleting the tag from the XML and it wonยดt get introduced again:
Does Inkscape always works that way or just started after an update? if the latter please consider: Inkscape Preference->System hit "Reset Preferences" and restart Inkscape. Fingers crossed.
Open Inkscape Preferences then [Behaviour > Transforms > Store Transformation > Optimised]. In your case [Store Transformation > Preserved] applies a transform when you scale an object in your drawing, instead of recalculating the node positions.
I should have remembered this sooner, but I think we finally got there.
โ I'm on Windows 10, German edition, and on Inkscape Inkscape 1.2 (dc2aedaf03, 2022-05-15).
โ I've got a document containing a path atop a rectangle, both having an equal stroke width of 5 px.
โ I've unset the preferences option to scale stroke width.
โ I've unset the icon in the top right corner with the tooltip, โWhen scaling objects, scale the stroke width by the same proportionโ.
โ I select both objects and transform the width, not the height.
See 1st screenshot, highlighting in purple just what I did.
I was hoping that the stroke width should remain at 5 px after the transformation, just as I specified. But instead, the transformation does affect the stroke width; it is now far thicker than 5 px at the top and bottom and far thinner than 5 px at the sides. This pertains to the pure path (top) as well as to the rectangle (bottom).
So how do I stop this annoying effect? Extensive googling hasn't turned up an answer, besides turning off the two options that I did turn off.
Seems you put it as a group; ungroup and transform again please.
("ungrounded"? Damn autocorrection) ๐
You can also do this without ungrouping. [double-click] or [ctrl+return] to enter the group. Select all [ctrl+a]. Now you can stretch your shapes, preserving the stroke thickness. [ctrl+backspace] to leave the group.
A simple ungroup and regroup usually works for me.
In the original experiment above, I selected the two objects together, I didn't group them. But, fair enough:
I'm repeating the experiment using just 1 object, a path with 3 nodes. Shrinking the path horizontally but not vertically still repeats the effect that the stroke width is scaled, and scaled unevenly.
@Paddy_CAD
It seems that your second constellation shows the effect I was talking about: The stroke thickness in the horizontal portions of the stroke is bigger than the thickness in the vertical portions. The third constellation is different: Now the strokes have uniform thickness. What did you do to get from #2 to #3?
..
Can you show us a screenshot of the 2 parts you selected in the first screenshot in the Object->Layers and Objects panel?
@Polygon
Here you go. I'm attaching:
In all cases, the stroke at the top & bottom becomes thicker, the strokes at the sides become thinner.
In my comment #3 above, the centre shapes are a group of two objects. Scaling svg groups stretches stokes and fills alike. The shapes on the right are not grouped so stroke widths were preserved. This is the expected behaviour.
I opened your svg attachment and used the Select tool [s] to stretch the shapes. Stroke thickness was preserved. I see thinning and thickening of strokes while dragging the selection handle, but it reverts to the original stroke width when I release the mouse button.
The XML Editor shows transforms applied to your shapes so I went to Inkscape Preferences then [Behaviour > Transforms > Scale stroke width]. This changed from no thickening to uniform thickening, but not the uneven thickening in your screenshots.
I'm at a loss. I can't explain your experience. What happens if you use the node tool [n] and [ctrl+drag] to scale the shapes?
What can I do to show you more about my setup?
Here's the preferences.xml file in %APPDATA%/Roaming/Inkscape (attached).
Perhaps you can download this svg image. Scale the shapes and tell us what happens.
Pretty sure you scaled the Layer and not the object then:
This Transform Matrix will stay alive and is valid for any applied objects unless youยดll correct it or delete that layer and generate a new one:
Well spotted Polygon!
@Polygon
So, here's an all new document (attached, uneven-stroke0.svg).
Iยดm not able to recreate this following your steps. Are you really sure youยดre not scaling the Layer instead of the rectangle by accident? Once you scaled the Layer all objects will have a transform matrix unless you delete it in XML editor.
I don't know what to say.
I'm now including a film (window capture) that shows exactly what I'm doing, in file 2023-10-28_18-30-50.mp4. I've saved the document immediately before that (uneven-stroke0.svg) and immediately afterwards (uneven-stroke1.svg)
I've opened both files in Notepad++ and had it compare them to each other, and I can't see any transformation to the group <g โฆ id="layer1"> that might have been added by my handling. Differences would be highlighted in the screenshot uneven_stroke6.png. In the "before" document uneven-stroke0.svg, the group does not have a transformation, as also shown in the screenshot.
The result is in the screenshot uneven-stroke6.png, attached, showing the stroke distortion. Even when I close Inkscape completely and re-open it with uneven-stroke1.svg, it shows the distortion (shown in screenshot uneven-stroke6.png).
Note that I'm transforming the rectangle, not the triangle, which both are children of the layer. If I was transforming the layer, wouldn't both the triangle and the rectangle be affected?
I still donยดt get how you introduce the transform matrix just by scaling the object horizontally. This is how your file works here. Notice that Iยดm deleting the tag from the XML and it wonยดt get introduced again:
Does Inkscape always works that way or just started after an update? if the latter please consider: Inkscape Preference->System hit "Reset Preferences" and restart Inkscape. Fingers crossed.
Open Inkscape Preferences then [Behaviour > Transforms > Store Transformation > Optimised]. In your case [Store Transformation > Preserved] applies a transform when you scale an object in your drawing, instead of recalculating the node positions.
I should have remembered this sooner, but I think we finally got there.
Hurray. Never touched this in Preferences so I totally forgot about this.
@Paddy_CAD
Can confirm that setting Edit > Preferences > Behavior > Transforms > Store Transformation to โOptimizedโ solved my problem.
Thanks a lot!