Fix slight Y position offset in HandleDrag

This commit is contained in:
Derrick Timmermans
2021-07-20 23:00:58 +02:00
parent bfec87b082
commit a8cf6a6854

View File

@ -309,7 +309,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
public override bool HandleDrag(MouseButtonEvent e) public override bool HandleDrag(MouseButtonEvent e)
{ {
// The dragbox should only be active if the mouseDownPosition.Y is within this drawable's bounds. // The dragbox should only be active if the mouseDownPosition.Y is within this drawable's bounds.
if (DrawRectangle.Top > e.MouseDownPosition.Y || DrawRectangle.Bottom < e.MouseDownPosition.Y) float localY = ToLocalSpace(e.ScreenSpaceMouseDownPosition).Y;
if (DrawRectangle.Top > localY || DrawRectangle.Bottom < localY)
return false; return false;
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom; selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;