-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix undo/redo being locked up when a MouseUp event occurs while an object is being dragged #33312
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't managed to find any breakage here but this 200% needs to be covered by tests because editor input handling code is horribly complex and I'm not going to allow guards with non-obvious purpose without documenting what they're for, in the form of inline comments and/or test coverage.
Test should live in osu.Game.Tests.Visual.Editing.TestSceneComposerSelection.
|
I've added a comment explaining the purpose of the guard clause and test coverage covering the process of dragging an object -> delete via middle click -> undo. I assume this should be good since other processes of testing right click instead or other mouse clicks instead would essentially be repeating the same test, unless I'm completely overlooking something. |
- Use constraints for better assert messages - Use `Editor.Undo()` rather than manual input manager synthesizing ctrl-z (ctrl-z is not a platform agnostic binding, see macOS)
Partially addresses #32543, specifically "Ctrl + Z doesn't bring the deleted object back" (since I believe they're just accidentally middle-clicking while scrolling)
When you quick-delete an object in the editor while it's being dragged (either through a middle mouse button click or shift + right click), it causes the entire undo/redo system to break. I believe that this is caused by
changeHandlernever being able to callEndChange, asisDraggingBlueprintis erroneously set to false by the middle (or right) mouse button click.We can fix this with a simple check to see if the MouseUpEvent was specifically caused by the left mouse button.
quick edit: im realizing that this isn't strictly related to objects being deleted, and undo/redo will be locked up when any sort of non left-click mouseup event occurs while an object is being dragged, so i'm renaming to be a bit more appropriate.
Video
Before
before.mp4
After
after2.mp4