FreeRaider wrote:Where am i wrong?
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.
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
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]
P.S. Make SURE you leave enough room in the skin for 1/2 of the StrokeWidth. You were not, and the stroke was being "truncated" on the top and left as it "grew". Setting either the X and Y of the meter or the X and Y of the shape within the meter to 10 will take care of it when you have a maximum StrokeWidth of 20.