It is currently March 29th, 2024, 4:53 am

Transparent shape with different corner radius

General topics related to Rainmeter.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Transparent shape with different corner radius

Post by eclectic-tech »

You are still using the 7 rectangle shape background in this package, not the 2 path shape version.; that is why you are seeing the line again.

In order to help use the path version background you need to define the values you use to determine the skin height below the header:
(75.5+39*#SkinState#+12*([MeasureRun]-1)) what do these numbers represent (especially the 75.5 and 39 values)?

In my second path examples the line height of every additional item below the header is calculated using a preset height of 68 (header and 1 item) plus 12 pixels for each additional core core displayed; these may need to be changed based on the height of your information.

In my illustra scale used a height of 14 pixels for each line of info and multiply that be the number of lines needed. If you have text and graphs with different heights, then separate calculations would be needed. That is why I ask you to define the number values for the height. Once you know the line height of your info, it should be easy to calculate the height for any number of lines of info.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Post by pul53dr1v3r »

eclectic-tech wrote: April 30th, 2019, 1:42 pm You are still using the 7 rectangle shape background in this package, not the 2 path shape version.; that is why you are seeing the line again.
i attached the latest "properly" working pkg since i still haven't done what i want with the path shape.
The line appears in your latest 2 path shapes modification without SkinHeight option etc.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Scale=1.79
; The number of displayed info lines (Cores, Memory, etc.)
LineItems=2
; The height of an info line
LineHeight=(14*#Scale#)
CornerRadius=(3*#Scale#)
Width=(196*#Scale#)
TopHeight=(27*#Scale#)
BodyHeight=(#TopHeight#+(#LineHeight#*#LineItems#))
StrokeWidth=(0.5*#Scale#)
Start=(#StrokeWidth#/2)

[MeterShape]
Meter=Shape
DynamicVariables=1

; Top Shape
Shape=Path ShapePath | StrokeWidth #StrokeWidth# | Stroke Color 160,160,160,255 | Fill Color 0,0,0,140 | #Scale#,#Scale#

ShapePath=#Start#,#TopHeight# | LineTo #Start#,(#Start#+(#CornerRadius#*2)) | CurveTo (#Start#+(#CornerRadius#*2)),#Start#,#Start#,#Start# | LineTo (#Width#-(#CornerRadius#*2)),#Start# | CurveTo #Width#,(#Start#+(#CornerRadius#*2)),#Width#,#Start# | LineTo #Width#,#TopHeight# | SetNoStroke 1 | LineTo #Start#,#TopHeight# | ClosePath 1

; Body Shape
Shape2=Path PathBody | StrokeWidth #StrokeWidth#  | Stroke Color 160,160,160,255 | Fill Color 0,0,0,140 | #Scale#,#Scale#

PathBody=#Start#,#TopHeight# | SetNoStroke 1 | LineTo #Width#,#TopHeight# | SetNoStroke 0 | LineTo #Width#,((#BodyHeight#+(#LineHeight#*#LineItems#))-(#CornerRadius#*2)) | CurveTo (#Width#-(#CornerRadius#*2)),(#BodyHeight#+(#LineHeight#*#LineItems#)),#Width#,(#BodyHeight#+(#LineHeight#*#LineItems#)) | LineTo (#Start#+(#CornerRadius#*2)),(#BodyHeight#+(#LineHeight#*#LineItems#)) | CurveTo #Start#,((#BodyHeight#+(#LineHeight#*#LineItems#))-(#CornerRadius#*2)),#Start#,(#BodyHeight#+(#LineHeight#*#LineItems#))| LineTo #Start#,#TopHeight# | ClosePath 1

Image

As to 75.5 and 39 values), it's height of the bottom shape without Graph + 39 for the Graph/whole part beneath the RAM info.
Image
SkinState determines if the graph is hidden (SkinState=0) or shown (SkinState=1)
MeasureRun provides the Cores number (1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34 & 36).

Edit:
But don't waste your time if it will take a lot of it. I'll probably go with this design from the gif. To make some use of that thorn.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Transparent shape with different corner radius

Post by eclectic-tech »

Between my old eyes and 37" monitor, I had to strain to see the line, but you are right, it is still visible when using the same color for the header and body.

But I have to wonder, why define a header if it is going to be the same color as the body?
Just define a single background shape with the fill color.

There is nothing that is going to prevent the adjacent edges of 2 identically colored shapes from exhibiting the shaded line due to how strokes are drawn, half inside and half outside the shape boundary.

I think you have decided on the best solution for you.

Happy coding! :thumbup:
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: Transparent shape with different corner radius

Post by pul53dr1v3r »

eclectic-tech wrote: May 1st, 2019, 2:38 am
Yea, it's hardly visible but i won't pay any attention to it from now on. Not worth it, as you said.
Your help was really EXCELLENT no matter what.
Rainy has got some "issues", but nothing we can't live with.

Respect to you electic mate, your effort, wish t help and being the man! :bow: