Use colour fade transform for selection box controls

To become harminous with the fade transforms of the rotation control
This commit is contained in:
Salman Ahmed
2021-04-25 07:43:56 +03:00
parent 62bcc5f76d
commit ab71782674
3 changed files with 10 additions and 4 deletions

View File

@ -17,6 +17,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// </summary>
public abstract class SelectionBoxControl : CompositeDrawable
{
public const double TRANSFORM_DURATION = 100;
public event Action OperationStarted;
public event Action OperationEnded;
@ -90,8 +92,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
protected virtual void UpdateHoverState()
{
circle.Colour = HandlingMouse ? Colours.GrayF : (IsHovered ? Colours.Red : Colours.YellowDark);
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, 100, Easing.OutQuint);
if (HandlingMouse)
circle.FadeColour(Colours.GrayF, TRANSFORM_DURATION, Easing.OutQuint);
else
circle.FadeColour(IsHovered ? Colours.Red : Colours.YellowDark, TRANSFORM_DURATION, Easing.OutQuint);
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, TRANSFORM_DURATION, Easing.OutQuint);
}
protected void OnOperationStarted()