Consider drag handles active using mouse down instead of when dragged

This commit is contained in:
Salman Ahmed
2021-05-04 06:40:43 +03:00
parent 5f33c3514e
commit b2a0c2b563
5 changed files with 29 additions and 27 deletions

View File

@ -62,8 +62,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
handle.HoverGained += updateRotationHandlesVisibility;
handle.HoverLost += updateRotationHandlesVisibility;
handle.OperationStarted += updateRotationHandlesVisibility;
handle.OperationEnded += updateRotationHandlesVisibility;
handle.MouseDown += updateRotationHandlesVisibility;
handle.MouseUp += updateRotationHandlesVisibility;
allDragHandles.Add(handle);
}
@ -72,13 +72,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void updateRotationHandlesVisibility()
{
if (activeHandle?.InOperation == true || activeHandle?.IsHovered == true)
if (activeHandle?.IsHeld == true || activeHandle?.IsHovered == true)
return;
displayedRotationHandle?.FadeOut(SelectionBoxControl.TRANSFORM_DURATION, Easing.OutQuint);
displayedRotationHandle = null;
activeHandle = allDragHandles.SingleOrDefault(h => h.InOperation);
activeHandle = allDragHandles.SingleOrDefault(h => h.IsHeld);
activeHandle ??= allDragHandles.SingleOrDefault(h => h.IsHovered);
if (activeHandle != null)