Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get a precise position of the widget #11

Open
Emafire003 opened this issue Jul 25, 2023 · 0 comments
Open

How to get a precise position of the widget #11

Emafire003 opened this issue Jul 25, 2023 · 0 comments

Comments

@Emafire003
Copy link

Hi, I'm trying to make this widget disapper whenever it gets enough distance from the center. The problem is that when getting the position from the dragcontroller it oftern unreliable. The way i'm doing is: Getting the first position the first time the widget is built, and save it to a startPos variable. Then, every time the widget is dragged (checking with onPointerMove) I get the position again with getCurrent position. The new position that i'm getting often varies a lot even if the widget is placed in the exact same spot, like setting it to the topleft. Like one time the first value of the offset is 144, and the when i do it again it's 90 or even 0.0. Any ideas on how to resolve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant