Youkai1977 wrote: ↑April 6th, 2021, 9:24 amHere is the code as I rewrote it to try to get 4px curves.
Sorry, but this doesn't use 4px curves. How could it, when you used
LineTo 148,0 instead of
LineTo 146,0 (since 150-4=146 and not 148), or
CurveTo 150,3,146,0,150,0 instead of
CurveTo 150,4,146,0,150,0?
Anyway, I had some mistakes in my code as well, so here is the correct implementation:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!ToggleMeterGroup ButtonGroup][!Redraw]
---Meters---
[BTN_1]
Group=ButtonGroup
Meter=SHAPE
X=0
Y=1
Shape=Rectangle 0,0,150,29,4 | StrokeWidth 0 | Fill Color 255,0,0,255
Shape2=Rectangle -2,24,30,8 | StrokeWidth 0 | Skew 45,0
Shape3=Rectangle 0,20,4,4 | StrokeWidth 0
Shape4=Rectangle 0,16,8,8,4 | StrokeWidth 0
Shape5=Combine Shape | Exclude Shape2 | Exclude Shape3 | Union Shape4
UpdateDivider=-1
[BTN_2]
Group=ButtonGroup
Hidden=1
Meter=Shape
X=0
Y=1
Shape=Path MyPath | StrokeWidth 0 | Stroke Color 255,255,255,255 | Fill Color 255,0,0,255
MyPath=4,0 | LineTo 146,0 | CurveTo 150,4,146,0,150,0 | LineTo 150,25 | CurveTo 146,29,150,25,150,29 | LineTo 29,29 | LineTo 24,24 | LineTo 4,24 | CurveTo 0,20,4,24,0,24 | LineTo 0,4 | CurveTo 4,0,0,4,0,0 | ClosePath 1
UpdateDivider=-1
The two meters are drawn using the same fill color now (different colors produce different effects on the human eye, e.g. a brighter color might make a shape look larger than a shape drawn using a darker color, despite them being the same), but one of those meters is hidden at all times. Comparing them is easy, just click on the skin and the hidden meter will be shown, while the previously shown meter will be hidden instead. Quickly clicking will help in rating whether the 2 shapes are exactly the same. Basically, if they are the same, you should notice no difference when clicking the skin.
Explaining the path values, and their relation with the 4px rounded corner radius:
Code: Select all
MyPath=(0+4),0 | LineTo (150-4),0 | CurveTo 150,(0+4),(150-4),0,150,0 | LineTo 150,(29-4) | CurveTo (150-4),29,150,(29-4),150,29 | LineTo 29,29 | LineTo 24,24 | LineTo (0+4),24 | CurveTo 0,(24-4),(0+4),24,0,24 | LineTo 0,(0+4) | CurveTo (0+4),0,0,(0+4),0,0 | ClosePath 1
So, you need to either add or subtract 4 from the "corners" of the original (0,0) to (150,29) rectangle used as a base for the shape, depending on which segment of the path you're at. My previous mistake was thinking the (29,29) and (24,24) path points were related to the rounded corner radius, but it appears they were not in their original form (i.e. they depended on the coordinates and the skew you applied to the 2nd rectangle in the original meter), so I established the points using a combination of looking at those coordinates and a little bit of trial and error (didn't want to use math just for that). That's why you don't see 4 being added or subtracted to get the coordinates of those points, but you do on the other path points.