AnchorX/AnchorY Not working at all

Report bugs with the Rainmeter application and suggest features.

AnchorX/AnchorY Not working at all

May 20th, 2018, 2:06 pm
Ashtefere
   [7 posts]

As stated.

Tested on latest beta with latest windows. Rainmeter skin doesn't change its behaviour at all with any AnchorX/AnchorY setting, as if it is ignored.
User avatar

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 2:26 pm
jsmorley
Developer   [17587 posts]

Need to know what you are trying to accomplish. AnchorX and AnchorY certainly work, but are used in conjunction with WindowX and WindowY.

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 2:58 pm
Ashtefere
   [7 posts]

I just checked again.

What doesnt work:

Rainmeter.ini

Code: Select all

AnchorX=50%
AnchorY=50%


Skin Bang

Code: Select all

[!Move "#WORKAREAWIDTH#/2" "#WORKAREAHEIGHT#/2" targetSkin]


or

Code: Select all

[!Move "50%" "50%" targetSkin]


This results in:

Image

What does work:

Code: Select all

AnchorX=50%
AnchorY=50%
WindowX=50%
WindowY=50%


This results in:

Image

I would assume that the !Move bang will move the skin by it's anchor. Is this not the intended behavior?
User avatar

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:15 pm
jsmorley
Developer   [17587 posts]

Let us dig into this... It's possible that !Move does not take AnchorX/AnchorY into consideration.

In the meantime, I'd be tempted to do something like:

Code: Select all

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

[MeasureMove]
Measure=Calc
UpdateDivider=-1
OnUpdateAction=[!Move "((#SCREENAREAWIDTH#/2)-(#CURRENTCONFIGWIDTH#/2))" "((#SCREENAREAHEIGHT#/2)-(#CURRENTCONFIGHEIGHT#/2))"]
DynamicVariables=1

[MeterImage]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255


I put the !Move in an OnUpdateAction in a measure in the skin, rather than in [Rainmeter] as an OnRefreshAction, so it will be able to know the value of #CURRENTCONFIGWIDTH# / #CURRENTCONFIGHEIGHT#, which must be used "dynamically", and [Rainmeter] can't do that.
User avatar

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:21 pm
jsmorley
Developer   [17587 posts]

Here is a trick that isn't commonly known...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnRefreshAction=[!Move "(([#SCREENAREAWIDTH]/2)-([#CURRENTCONFIGWIDTH]/2))" "(([#SCREENAREAHEIGHT]/2)-([#CURRENTCONFIGHEIGHT]/2))"]

[MeterImage]
Meter=Image
W=100
H=100
SolidColor=255,0,0,255


Note that in this case I HAVE put the action into an OnRefreshAction in the [Rainmeter] section. Why does this work, when I stated above that #CURRENTCONFIGWIDTH# / #CURRENTCONFIGHEIGHT# can't be "dynamic" in the [Rainmeter] section?

https://docs.rainmeter.net/manual/variables/nesting-variables/

It's because all [#NestedVariables] are always dynamically resolved when they are used in a bang, and so are always used in a "dynamic" way, even in the [Rainmeter] section of the skin. Regular #Variables# are not by nature dynamic, and must be used with DynamicVariables=1 in measures or meters, and can't be dynamic in [Rainmeter].

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:25 pm
Ashtefere
   [7 posts]

I would do this, but unfortunately that is now how the skin needs to work.

I have the top bar skin with an button (meter), that when hovered with the mouse should do this:

Image

The skin should center it's X position on the hovered meter.

This works fine on any skins that have a fixed with (I just do some math) but for dynamic width skins there is not a solution.

!Move taking AnchorX into consideration would solve this (and seems like this should be the actual behaviour) but without that, I would need to do a bunch of !Setvariable, !UpdateMeasure, !OnUpdate stuff to get that to work, which is not ideal.

Is there any chance of getting the !move bang to recognize the AnchorX/Y setting? And while I'm begging for things, a !SetAnchorX/Y bang would also be great.
User avatar

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:28 pm
jsmorley
Developer   [17587 posts]

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:33 pm
Ashtefere
   [7 posts]

Won't work in my instance, as the X position I need is dynamic at any time, and the width of the meter is dynamic at any time. I will use the !SetVariable/!UpdateMeasure/!OnUpdate trick in the mean time.
User avatar

Re: AnchorX/AnchorY Not working at all

May 20th, 2018, 3:41 pm
jsmorley
Developer   [17587 posts]

Ashtefere wrote:Won't work in my instance, as the X position I need is dynamic at any time, and the width of the meter is dynamic at any time. I will use the !SetVariable/!UpdateMeasure/!OnUpdate trick in the mean time.


Gotcha.. Ok, well we will look into this.
User avatar

Re: AnchorX/AnchorY Not working at all

June 6th, 2018, 12:50 am
Virginityrocks
   [486 posts]

I like the skin you're working on. What's its name?

Return to “Bugs & Feature Suggestions”



Who is online

Users browsing this forum: No registered users and 1 guest