Skip to content

interact_pointer_pos incorrect behavior or documentation #5863

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

Open
oscargus opened this issue Mar 30, 2025 · 1 comment
Open

interact_pointer_pos incorrect behavior or documentation #5863

oscargus opened this issue Mar 30, 2025 · 1 comment
Labels
bug Something is broken

Comments

@oscargus
Copy link
Contributor

Describe the bug

The documentation of interact_pointer_pos says:
"Where the pointer (mouse/touch) were when this widget was clicked or dragged."
I interpret that as the start point of the dragging/click. However, it seems like it is the current position of the mouse.

Ideally (for me), it should be as described as I need to get the exact start position of a drag and, since, it requires a bit of dragging to determine that drag happens, I think that corresponds to return press_origin?

If it behaves as expected, one should probably rephrase the documentation.

To Reproduce
Steps to reproduce the behavior:

  1. Add something like
        if let Some(pp) = response.interact_pointer_pos() {
            dbg!(pp);
        }
  1. Click and drag.

Expected behavior
The value should not change (if the doc is correct).

Screenshots

Desktop (please complete the following information):

  • OS:
  • Browser
  • Version

Smartphone (please complete the following information):

  • Device:
  • OS:
  • Browser
  • Version

Additional context

@oscargus oscargus added the bug Something is broken label Mar 30, 2025
@lucasmerlin
Copy link
Collaborator

I believe the behavior is working as intended, and the usecase is to get the position of the tap in touch events. Since the click is triggered when the finger is lifted and lifting triggers a PointerGone event, hover_pos would be None during the click frame, and interact_pointer_pos is still Some (remembering the position from the last frame).

I get that the wording is confusing though, that could definitely be improved.

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

No branches or pull requests

2 participants