It is currently April 25th, 2024, 8:45 pm

bug calculating [Meter:XW] on shape meter

Report bugs with the Rainmeter application and suggest features.
iampedestrian
Posts: 4
Joined: May 5th, 2019, 3:18 pm

bug calculating [Meter:XW] on shape meter

Post by iampedestrian »

Hi guys,

I'm creating new shape meter and wanted to automatically adjust its position, but [Meter:XW] is calculating without width

code:

Code: Select all

[Text]
Meter=String
AntiAlias=1
StringAlign=Left
DynamicVariables=1
X=60
Y=6
Text=Naya

[Colors]
Meter=Shape
Shape=Ellipse ([Text:XW]+20),45,7,7 | Fill Color #white# | StrokeWidth 0
Shape2=Ellipse ([Text:X]+20),60,7,7 | Fill Color #blue# | StrokeWidth 0

[Text1]
Meter=String
StringAlign=Left
DynamicVariables=1
FontColor=255,255,255
Text=[Text:XW]
X=[Text:XW]
Y=37

[Text2]
Meter=String
StringAlign=Left
DynamicVariables=1
FontColor=255,255,255
Text=[Text:X]
X=[Text:X]
Y=52
image, how it looks:
Image

Pedestrian
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: bug calculating [Meter:XW] on shape meter

Post by jsmorley »

You have to use DynamicVariables=1 on any measure or meter where you are using [SectionVariables]. That would include the Shape meter in your example.

1.png
You do not have the required permissions to view the files attached to this post.
iampedestrian
Posts: 4
Joined: May 5th, 2019, 3:18 pm

Re: bug calculating [Meter:XW] on shape meter

Post by iampedestrian »

thanks jsmorley,

That's it, but interestingly, why is [Meter:X] calculating X position even without DynamicVariables?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: bug calculating [Meter:XW] on shape meter

Post by jsmorley »

If a value on a meter is explicitly defined and fixed, like X=60, then another meter using it will not need DynamicVariables=1 to get that value with [Meter:X], but if the value is in any way "derived", or changes based on any other value, the [Meter:X] will only ever see the first, original, fixed value.


So for instance, if I had a skin like this:

Code: Select all

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

[MeterOne]
Meter=String
X=40
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=MeterOne

[MeterTwo]
Meter=String
X=40
Y=30
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
;DynamicVariables=1
Text=[MeterOne:X] | [MeterOne:W]
1.png
The value of [MeterOne:X] is an explicit and fixed value, and MeterTwo is able to see it even without DynamicVariables=1. However, note that the value of [MeterOne:W] is not explicit or fixed, but is "derived" when the meter is actually drawn. That value is "dynamically" created on the fly. All it is seeing is the fixed Padding that is on the meter. The width of MeterOne is zero before it is drawn the first time.

If I change it to:

Code: Select all

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

[MeterOne]
Meter=String
X=40
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=MeterOne

[MeterTwo]
Meter=String
X=40
Y=30
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1
Text=[MeterOne:X] | [MeterOne:W]
2.png
Than as you can see, the dynamic value is returned.
You do not have the required permissions to view the files attached to this post.
iampedestrian
Posts: 4
Joined: May 5th, 2019, 3:18 pm

Re: bug calculating [Meter:XW] on shape meter

Post by iampedestrian »

Is position of shape considered as fixed?
Does [Meter:X] "cascade" to meter where are fixed values used first?

This is original code I have, but still seing circles of second shape meter on same position

Code: Select all

[Naya_Colors]
Meter=Shape
Shape=Ellipse 27,45,7,7 | Fill Color #MTGwhite# | StrokeWidth 0
Shape2=Ellipse 37,45,7,7 | Fill Color #MTGred# | StrokeWidth 0
Shape3=Ellipse 47,45,7,7 | Fill Color #MTGgreen# | StrokeWidth 0

[Naya_Text]
Meter=String
AntiAlias=1
StringAlign=Left
FontColor=#CurF_Color#
FontFace=#FF_Rubik#
FontSize=12
DynamicVariables=1
X=([Naya_Colors:XW]+12)
Y=36
Text=Naya

[Esper_Colors]
Meter=Shape
Shape=Ellipse ([Naya_Text:XW]+20),45,7,7 | Fill Color #MTGwhite# | StrokeWidth 0
Shape2=Ellipse ([Naya_Text:X]+20),55,7,7 | Fill Color #MTGblue# | StrokeWidth 0
Shape3=Ellipse 47,45,7,7 | Fill Color #MTGblack# | StrokeWidth 0
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: bug calculating [Meter:XW] on shape meter

Post by jsmorley »

No X or Y or W or H value is "fixed" unless it is explicitly defined in the meter. If not, then if is "derived" as the meter is drawn.

The long and the short of it is you should just ALWAYS use DynamicVariables=1 on any measure or meter where you are using a [SectionVariable].
iampedestrian
Posts: 4
Joined: May 5th, 2019, 3:18 pm

Re: bug calculating [Meter:XW] on shape meter

Post by iampedestrian »

thanks for the explanation