guix icon indicating copy to clipboard operation
guix copied to clipboard

The circle of the needle of circular gauge is not fixed when needle rotates

Open WeizhongFan opened this issue 3 years ago • 4 comments

It can be reproduced by the official example demo_guix_widget_types.

When we change the gauge value, the needle rotates. But we can see that the circle of needle shifts a bit both vertically and horizontally along with the angle change.

needle

WeizhongFan avatar Nov 24 '21 09:11 WeizhongFan

Please make sure the property "Needle Xcor" and "Needle Ycor" are set properly. circular_gauge_properties

"Needle Xcor" is the distance from the left of the needle image to the center of rotation of the gauge needle. "Needle Ycor" is the distance from the top of the needle image to the center of rotation of the gauge needle. Please reference the documentation about GX_CIRCULAR_GAUGE_INFO. https://docs.microsoft.com/en-us/azure/rtos/guix/appendix-i#gx_circular_gauge_info

ting-ms avatar Nov 24 '21 09:11 ting-ms

Hi, Ting

Thanks for the quick reply.

I set exactly same params as you, but the shift can still be seen. It's very little shift, looks like just 1 pixel. But we're making a smart watch, and we use it for a second needle of a watch face. The second needle keeps rotating, so the shifts is observable by users. 4b8ba24bb18c3fef30df43240edfbd5

f105bc374d57bd1e736168ad2d80255

WeizhongFan avatar Nov 24 '21 10:11 WeizhongFan

GUIX supports integer numbers only for the Needle Xcor and Ycor. The specified Xcor and Ycor are not exactly the center of the circle(half pixel error). That may cause drifting when rotating. My recommendation is to change the needle image so that the actual coordinates of the circle center are integer numbers.

ting-ms avatar Nov 25 '21 01:11 ting-ms

Hello @WeizhongFan,

Can you make the change suggested and does this fix the issue? I need to know if we can close the issue or if we need to add a task to our backlog to investigate sub-pixel coordinates.

jdeere5220 avatar Nov 30 '21 14:11 jdeere5220