mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 13:28:03 +09:00
Schedule drag events for now
This commit is contained in:
parent
30c3fcb4ea
commit
c47497923a
@ -13,6 +13,7 @@ using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
using osu.Game.Graphics;
|
||||
@ -371,10 +372,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
return true;
|
||||
}
|
||||
|
||||
private ScheduledDelegate dragOperation;
|
||||
|
||||
protected override void OnDrag(DragEvent e)
|
||||
{
|
||||
base.OnDrag(e);
|
||||
|
||||
// schedule is temporary to ensure we don't process multiple times on a single update frame. we need to find a better method of doing this.
|
||||
// without it, a hitobject's endtime may not always be in a valid state (ie. sliders, which needs to recompute their path).
|
||||
dragOperation?.Cancel();
|
||||
dragOperation = Scheduler.Add(() =>
|
||||
{
|
||||
OnDragHandled?.Invoke(e);
|
||||
|
||||
if (timeline.SnapScreenSpacePositionToValidTime(e.ScreenSpaceMousePosition).Time is double time)
|
||||
@ -423,6 +431,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
protected override void OnDragEnd(DragEndEvent e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user