It is currently December 6th, 2022, 1:27 pm

## Check Snap Orientation with if condition

Get help with creating, editing & fixing problems with skins
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

### Re: Check Snap Orientation with if condition

balala wrote: November 6th, 2022, 8:13 pm An improvement of the code: I replaced the [MeasureTangent] measure with the following [MeasureOrientation]. This measure returns a number which represents the number of degrees from the upper vertical line (drawn from the center of the screen to the center of its upper edge) to the line drawn from the center of the screen to the center of the skin, as shown below:

Degree.png

Having this number, you can extremely easily create the proper IfConditions to get the desired result. Hope you got how...
The code of the measure (only the measure, with no other sections and no IfConditions):

Code: Select all

``````[MeasureOrientation]
Measure=Calc
Formula=(( 360 + Deg ( Atan2 (( #WORKAREAWIDTH# / 2 - ( #CURRENTCONFIGX# + #CURRENTCONFIGWIDTH# / 2 )), ( #WORKAREAHEIGHT# / 2 - ( #CURRENTCONFIGY# + #CURRENTCONFIGHEIGHT# / 2 ))))) % 360 )
DynamicVariables=1``````
Well thanks, that works brilliantly and reduces the code quite a bit.
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Check Snap Orientation with if condition

Fatty-Do-Do wrote: November 6th, 2022, 8:24 pm Well thanks, that works brilliantly and reduces the code quite a bit.
Did you try it out? Does work?
Fatty-Do-Do
Posts: 15
Joined: October 29th, 2022, 12:32 pm

### Re: Check Snap Orientation with if condition

balala wrote: November 6th, 2022, 8:29 pm Did you try it out? Does work?
It does. I just defined the IfConditions as =0<#CURRENTSECTION#<45, 45<#CURRENTSECTION#<90, etc. and that worked brilliantly. Thanks again
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Check Snap Orientation with if condition

Fatty-Do-Do wrote: November 7th, 2022, 10:03 am It does. I just defined the IfConditions as =0<#CURRENTSECTION#<45, 45<#CURRENTSECTION#<90, etc. and that worked brilliantly. Thanks again