Sorry, it was my bad above... You need to divide the StrokeWidth in half when you use it to change the "size" of the shape, if you want the overall meter size to stay constant while you change the StrokeWidth. Again, half the stroke is "inside" and half "outside", so the net effect of the stoke on the size is really (Ceil(StrokeWidth /2)). Don't worry about "ceiling" it, Rainmeter will do that automatically since it can't understand half pixels.FreeRaider wrote:Where am i wrong?
In order to have a shape that has a StrokeWidth of 10, and the entire shape, including the stroke, MUST be exactly 200 wide, you can certainly do that. You just have to define the "size" of the shape with a value that is (200 - (StrokeWidth/2)). So the shape will have a width of 190, half the StrokeWidth will be added to the left, and half to the right, and the resulting meter will be exactly 200 wide.
Code: Select all
[MeterRectangle]
Meter=Shape
X=10
Y=10
Shape=Rectangle 0,0,(100-(#sw#/2)),(100-(#sw#/2)) | StrokeWidth #sw# | Fill Color 255,0,0,255
MouseScrollDownAction=[!SetVariable sw "(#sw#<20 ? (#sw#+1) : 20)"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable sw "(#sw#>1 ? (#sw#-1) : 0)"][!UpdateMeter *][!Redraw]
DynamicVariables=1