Well thanks, that works brilliantly and reduces the code quite a bit.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
It is currently March 28th, 2024, 2:05 pm
Check Snap Orientation with if condition
-
- Posts: 15
- Joined: October 29th, 2022, 12:32 pm
Re: Check Snap Orientation with if condition
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Check Snap Orientation with if condition
Did you try it out? Does work?Fatty-Do-Do wrote: ↑November 6th, 2022, 8:24 pm Well thanks, that works brilliantly and reduces the code quite a bit.
-
- Posts: 15
- Joined: October 29th, 2022, 12:32 pm
- balala
- Rainmeter Sage
- Posts: 16109
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Check Snap Orientation with if condition
Glad to help.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