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

Merged
merged 1 commit into from
Nov 14, 2024

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.
@kwvanderlinde kwvanderlinde force-pushed the bugfix/5032-jumpy-map-drag branch from 661c2dc to 85cfb29 Compare November 13, 2024 05:22
@cwisniew cwisniew added this pull request to the merge queue Nov 14, 2024
Merged via the queue into RPTools:develop with commit cb93818 Nov 14, 2024
4 checks passed
@kwvanderlinde kwvanderlinde deleted the bugfix/5032-jumpy-map-drag branch November 15, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[Bug]: Map dragging sometimes jumps by a lot when moving a token
2 participants