Copy link to clipboard
Copied
Hi. I'm trying to maintain stroke width when scaling a shape, and I use the expression below (added to the "Stroke Width" property). It works when scaling with both axis constrained. However, if I scale the axis separately, the expression doesn't work anymore. Is there something I can add to it so that the stroke thickness remains the same when scaling them independently?
value*(100/transform.scale[0])
Thanks
Copy link to clipboard
Copied
The easiest way to maintain a stroke width when scaling a shape layer is to move the stroke below Transform Shape and then use the Transform Shape/Scale instead of layer scale.
You can't maintain a constant stroke width if you scale the layer using different X and Y values because there is no way to know which part of the stroke needs to be adjusted or tapered. The best you could do is average the scale values and divide the original stroke width by the scale factor like this:
sv = transform.scale;
avScale = (sv[0] + sv[1])/2;
sFactor = avScale * .01;
value / sFactor
That will give you this when the X scale value is 50 and the Y is 100:
Changing only the Y scale value will maintain the thickness of the vertical part of the stroke, but the horizontal part of the stroke is going to change with the layer scale.
Copy link to clipboard
Copied
Not sure if you still need a solution to this but in some situations you can put the object in a new shape layer group and add a merge paths, then adjust the scale in the in the original shape layer group.
Copy link to clipboard
Copied
Under path, change "Size"