From 0e363fce1e05118e929e3d598f10fef75f0c1ce3 Mon Sep 17 00:00:00 2001 From: Kelvin <2yangk23@gmail.com> Date: Tue, 29 Aug 2017 22:25:04 -0700 Subject: [PATCH] Try to fix stuttering behavior --- osu.Game/Overlays/Music/PlaylistItem.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Music/PlaylistItem.cs b/osu.Game/Overlays/Music/PlaylistItem.cs index 1491d7d0dd..9df15bfd04 100644 --- a/osu.Game/Overlays/Music/PlaylistItem.cs +++ b/osu.Game/Overlays/Music/PlaylistItem.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Graphics; @@ -151,6 +150,9 @@ namespace osu.Game.Overlays.Music { private readonly FillFlowContainer playlist; + private const int line_height = 22; + private const int rearrange_buffer = 3; + public PlaylistItemHandle(FillFlowContainer playlist) { this.playlist = playlist; @@ -202,7 +204,12 @@ namespace osu.Game.Overlays.Music max = m - 1; } - return (int)items[Math.Max(0, min - 1)].Depth; + int index = Math.Max(0, min - 1); + // Only move if mouse falls within buffer + if (position - items[index].Y > rearrange_buffer && position - items[index].Y < line_height - rearrange_buffer) { + return (int)items[index].Depth; + } + return (int)Parent.Depth; } } }