mirror of
https://github.com/ppy/osu.git
synced 2026-05-23 17:40:12 +08:00
Fix hotkey presses generating unnecessary undo history
The buttons don't check whether the operation they correspond to is
possible to perform in the current state of the selection box, so not
checking `Can{Reverse,Rotate}` causes superfluous undo states to be
added without any real changes if an attempt is made to reverse or
rotate a selection that cannot be reversed or rotated.
This commit is contained in:
@@ -171,13 +171,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
switch (e.Key)
|
||||
{
|
||||
case Key.G:
|
||||
return reverseButton?.TriggerClick() == true;
|
||||
return CanReverse && reverseButton?.TriggerClick() == true;
|
||||
|
||||
case Key.Comma:
|
||||
return rotateCounterClockwiseButton?.TriggerClick() == true;
|
||||
return CanRotate && rotateCounterClockwiseButton?.TriggerClick() == true;
|
||||
|
||||
case Key.Period:
|
||||
return rotateClockwiseButton?.TriggerClick() == true;
|
||||
return CanRotate && rotateClockwiseButton?.TriggerClick() == true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(e);
|
||||
|
||||
Reference in New Issue
Block a user