From 7d2af9310bc8f0b1e99cf86b0a05d7413c381887 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Apr 2017 15:20:20 +0900 Subject: [PATCH] Expose DragBar's seeking property. --- osu.Game/Overlays/DragBar.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/DragBar.cs b/osu.Game/Overlays/DragBar.cs index 251aed1ee4..90991bb195 100644 --- a/osu.Game/Overlays/DragBar.cs +++ b/osu.Game/Overlays/DragBar.cs @@ -16,7 +16,8 @@ namespace osu.Game.Overlays private readonly Box fill; public Action SeekRequested; - private bool isDragging; + + public bool IsSeeking { get; private set; } private bool enabled = true; public bool IsEnabled @@ -48,7 +49,7 @@ namespace osu.Game.Overlays public void UpdatePosition(float position) { - if (isDragging || !IsEnabled) return; + if (IsSeeking || !IsEnabled) return; updatePosition(position); } @@ -64,7 +65,7 @@ namespace osu.Game.Overlays private void updatePosition(float position) { position = MathHelper.Clamp(position, 0, 1); - fill.TransformTo(fill.Width, position, 100, EasingTypes.OutQuint, new TransformWidth()); + fill.TransformTo(fill.Width, position, 200, EasingTypes.OutQuint, new TransformSeek()); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) @@ -79,15 +80,15 @@ namespace osu.Game.Overlays return true; } - protected override bool OnDragStart(InputState state) => isDragging = true; + protected override bool OnDragStart(InputState state) => IsSeeking = true; protected override bool OnDragEnd(InputState state) { - isDragging = false; + IsSeeking = false; return true; } - private class TransformWidth : TransformFloat + private class TransformSeek : TransformFloat { public override void Apply(Drawable d) {