balala wrote: ↑June 5th, 2021, 8:55 pmAlright, thanks for the effort...
Yincognito wrote: ↑June 5th, 2021, 8:44 pmIn the search for the perfect workaround (I like perfection as you probably remember, LOL)...
Yincognito wrote: ↑June 5th, 2021, 9:16 pmIt'll be difficult to give up trying to fix this though, it's just not my style of backing off in front of a problem where I feel a reasonable solution is within grasp.
Well, it seems a good night sleep is a good adviser, after all. I found the perfect workaround, which doesn't produce any unwanted artefacts irrespective of the StrokeWidth value. I knew the key to this was to make the shape parts intersect "better" so that they "fully" cross-over one another and a higher stroke width won't cause loosing the actual intersection point (rounding errors, maybe?) and it was clear the ArcTo and CurveTo in the Path option were not doing any of the above, so I returned to basics. Arcs are simulated in Rainmeter by intersecting two ellipses in various ways, so drawing ellipses and intersecting them instead of drawing arcs is more or less the same, but it makes the problem go away ... as long as those ellipses
FULLY cross over one another (optionally taking a bit of StrokeWidth leeway into account):
Code: Select all
[Variables]
Style=0
[Rainmeter]
Update=-1
BackgroundMode=2
SolidColor=220,220,220
SkinWidth=140
SkinHeight=200
[Style0]
Shape=Path MyPath | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255
MyPath=10,65 | ArcTo 130,65,60,20,0,1,0 | ArcTo 10,65,60,80,0,0,0
[Style1]
Shape=Ellipse 70,65,60,80 | StrokeWidth 10 | Stroke Color 0,0,0 | Fill Color 255,255,255 | StrokeLineJoin Round
Shape2=Ellipse 70,0,100,85
Shape3=Combine Shape | Exclude Shape2
[MeterMouth]
Meter=Shape
X=0
Y=0
MeterStyle=Style#Style#
MouseScrollUpAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
MouseScrollDownAction=[!SetVariable Style (1-#Style#)][!UpdateMeter MeterMouth][!Redraw]
DynamicVariables=1
The default Style0 is the original form of the code with ArcTo-s (no workaround applied), while Style1 is the proper (but temporary, until the devs correct this) fix - mouse scroll to switch from one to another. The 1st ellipse is just the same as the 2nd ArcTo (bar the CenterX that is easy to calculate), but the having the 2nd ellipse
larger so that it
properly intersects the 1st one - which apparently doesn't happen in the ArcTo scenario - is the thing that does the trick. Using a smaller or a similar ellipse to the 1st ArcTo won't work, simply because due to unknown factors (rounding errors might possibly be the culprit here) the smaller ellipse won't properly "touch" or "cut" the 1st ellipse at the desired intersection points. It changes a bit the parameters one works with, true, but it completely solves the problem.
Comparison - before:
Comparison - Before.jpg
Comparison - after:
Comparison - After.jpg
P.S. I took the liberty to use ikarus1969's suggestion regarding rounding the line join in order to "smooth" the intersection points. It works without it too, but I feel it looks better this way.
P.S.S. There's only one possible drawback to this solution, if one has
DynamicWindowSize=1 in the
[Rainmeter] section and the larger ellipse makes the skin larger as well, but then these things can be fixed by placing stuff in a container. Not that nice, but it will work.