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

Fix map dragging state management in DefaultTool #5033

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Nov 5, 2024

Identify the Bug or Feature request

Fixes #5032

Description of the Change

The issue was caused by the combination of DefaultTool keeping around previous drag positions, and the surprising ability for mouseDragged() events to start before corresponding mousePressed() events if other mouse buttons are already presssed. This PR fixes the problem by clearing drag state whenever a drag completes, and double-checking that a map drag has actually begun when in mouseDragged().

Possible Drawbacks

None

Documentation Notes

N/A

Release Notes

  • Fixed a bug where the map can jump wildly if starting to drag it with other mouse buttons pressed.

This change is Reviewable

@kwvanderlinde kwvanderlinde self-assigned this Nov 5, 2024
@kwvanderlinde kwvanderlinde marked this pull request as ready for review November 5, 2024 11:59
When a drag is completed, the drag state is completely cleared so it can't be reused again later, even
accidentally. This ensures that we aren't affected by the strange case of a right-button drag event comming in before
the right-button press event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Awaiting-Review
Development

Successfully merging this pull request may close these issues.

[Bug]: Map dragging sometimes jumps by a lot when moving a token
1 participant