1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 16:13:34 +08:00

Add support for Ctrl + < / > to rotate selection in editor

As discussed in https://github.com/ppy/osu/discussions/24048.
This commit is contained in:
Dean Herbert 2023-06-27 17:01:40 +09:00
parent 7ddbf4eaa7
commit c6d952abe3

View File

@ -33,6 +33,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
public Action OperationEnded;
private SelectionBoxButton reverseButton;
private SelectionBoxButton rotateClockwiseButton;
private SelectionBoxButton rotateCounterClockwiseButton;
private bool canReverse;
@ -172,6 +174,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
case Key.G:
return reverseButton?.TriggerClick() ?? false;
case Key.Comma:
return rotateCounterClockwiseButton?.TriggerClick() ?? false;
case Key.Period:
return rotateClockwiseButton?.TriggerClick() ?? false;
}
return base.OnKeyDown(e);
@ -254,8 +262,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void addRotationComponents()
{
addButton(FontAwesome.Solid.Undo, "Rotate 90 degrees counter-clockwise", () => OnRotation?.Invoke(-90));
addButton(FontAwesome.Solid.Redo, "Rotate 90 degrees clockwise", () => OnRotation?.Invoke(90));
rotateCounterClockwiseButton = addButton(FontAwesome.Solid.Undo, "Rotate 90 degrees counter-clockwise", () => OnRotation?.Invoke(-90));
rotateClockwiseButton = addButton(FontAwesome.Solid.Redo, "Rotate 90 degrees clockwise", () => OnRotation?.Invoke(90));
addRotateHandle(Anchor.TopLeft);
addRotateHandle(Anchor.TopRight);