Image rotation on widget range are -180 and +179. To working, we have to add extra step.

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
natong
Posts: 80
Joined: 29 Aug 2015 05:24

Image rotation on widget range are -180 and +179. To working, we have to add extra step.

Post by natong » 30 May 2019 10:02

Screenshot_2019-05-30-16-39-49-634.png
Screenshot_2019-05-30-16-39-49-634.png (167.15 KiB) Viewed 11156 times
I am testing image rotation on widget.
Example the weather api report wind direction as 0 to 360 degree.

To working with AutoMagic, we have to add extra step:

Code: Select all

if ( degree - 179 >= 1 )
{
     degree = ( 360 - degree ) * -1;
}
Could you please adjust maximum value to -360 / +360 ?
or -180 / +180 ?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Image rotation on widget range are -180 and +179. To working, we have to add extra step.

Post by Martin » 30 May 2019 20:12

Hi,

I assume that you are using function setWidgetElementProperty to change the rotation. This method should not limit the range of the rotation to [-180,179]. The limitation is only enforced in the UI to keep the range of the slider as small as possible. A larger range would make it more difficult to place the slider accurately.

Regards,
Martin

natong
Posts: 80
Joined: 29 Aug 2015 05:24

Re: Image rotation on widget range are -180 and +179. To working, we have to add extra step.

Post by natong » 31 May 2019 06:33

oh! I forgot to test the limit with setWidgetElementProperty. Thank you very much.

Updated:
Tested with setWidgetElementProperty work very well without extra formula.

Locked