It is currently April 19th, 2024, 9:30 am

Roundline not resizing

Get help with creating, editing & fixing problems with skins
Vercte
Posts: 2
Joined: February 2nd, 2023, 4:30 pm

Roundline not resizing

Post by Vercte »

Whenever I try to resize a roundline in my code, it stays at 40,40 (W,H). If I resize it to another size, it stays the same but the center changes, say, 10 pixels left. Why does this happen, and why can't I resize it?

My code:

Code: Select all

[MeterCPUCircle]
Meter=Roundline
MeasureName=MeasureCPU
W=20
H=20
StartAngle=(Rad(270))
RotationAngle=(Rad(360))
LineColor=#white#
Solid=1
AntiAlias=1
X=2
Y=2
Image: https://imgur.com/yDXAExY
Last edited by Vercte on February 2nd, 2023, 7:04 pm, edited 1 time in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Roundline not resizing

Post by ikarus1969 »

Vercte wrote: February 2nd, 2023, 4:32 pm Whenever I try to resize a roundline in my code, it stays at 40,40 (W,H). If I resize it to another size, it stays the same but the center changes, say, 10 pixels left. Why does this happen, and why can't I resize it?
The roundline is always in the middle of a rectangle starting at the X and Y coordinates and width W, height H. If you omit W and H, the rectangle has its middle at X and Y. If you set W and H, lets say to 100 and 100 the roundlines starting point (the center of it) is at (X + 50) and (Y + 50). So the dimensions stay the same but the center has moved 50 pixels to the right and 50 pixels down.
You resize it by using the lineStart and LineLength parameter of the roundline.
https://docs.rainmeter.net/manual/meters/roundline/
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Roundline not resizing

Post by balala »

Vercte wrote: February 2nd, 2023, 4:32 pm Whenever I try to resize a roundline in my code, it stays at 40,40 (W,H). If I resize it to another size, it stays the same but the center changes, say, 10 pixels left. Why does this happen, and why can't I resize it?
What ikarus1969 meant above is that to get the Roundline meter at the desired size, you have to define the LineStart and especially the LineLength options on the meter. LineLength define the "external" radius of the Roundline meter, so in fact the double of this represents the size of the meter. LineStart is representing its internal radius, if defined the meter has a transparent area around the center of it. Since you didn't define none of these options, some default values are used for both.
So, long story short, to get the needed size, define the LineLength value. For instance if you add a LineLength=60 option to the meter, you get a Roundline with a radius of 60 pixels. Its diameter accordingly will be 120 pixels.
Vercte
Posts: 2
Joined: February 2nd, 2023, 4:30 pm

Re: Roundline not resizing

Post by Vercte »

balala wrote: February 2nd, 2023, 5:36 pm What ikarus1969 meant above is that to get the Roundline meter at the desired size, you have to define the LineStart and especially the LineLength options on the meter. LineLength define the "external" radius of the Roundline meter, so in fact the double of this represents the size of the meter. LineStart is representing its internal radius, if defined the meter has a transparent area around the center of it. Since you didn't define none of these options, some default values are used for both.
So, long story short, to get the needed size, define the LineLength value. For instance if you add a LineLength=60 option to the meter, you get a Roundline with a radius of 60 pixels. Its diameter accordingly will be 120 pixels.
Thank you! The naming of those properties are kinda confusing.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Roundline not resizing

Post by balala »

Vercte wrote: February 2nd, 2023, 7:27 pm The naming of those properties are kinda confusing.
Yep, might be. However take into account as well, what ikarus1969 said about the Roundline meters.