mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Change editor timeline mouse wheel handling to scroll by default (and zoom with alt held)
This commit is contained in:
@ -113,19 +113,18 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
|
||||
protected override bool OnScroll(ScrollEvent e)
|
||||
{
|
||||
if (e.IsPrecise)
|
||||
if (e.CurrentState.Keyboard.AltPressed)
|
||||
{
|
||||
// can't handle scroll correctly while playing.
|
||||
// the editor will handle this case for us.
|
||||
if (editorClock?.IsRunning == true)
|
||||
return false;
|
||||
|
||||
// for now, we don't support zoom when using a precision scroll device. this needs gesture support.
|
||||
return base.OnScroll(e);
|
||||
// zoom when holding alt.
|
||||
setZoomTarget(zoomTarget + e.ScrollDelta.Y, zoomedContent.ToLocalSpace(e.ScreenSpaceMousePosition).X);
|
||||
}
|
||||
|
||||
setZoomTarget(zoomTarget + e.ScrollDelta.Y, zoomedContent.ToLocalSpace(e.ScreenSpaceMousePosition).X);
|
||||
return true;
|
||||
// can't handle scroll correctly while playing.
|
||||
// the editor will handle this case for us.
|
||||
if (editorClock?.IsRunning == true)
|
||||
return false;
|
||||
|
||||
return base.OnScroll(e);
|
||||
}
|
||||
|
||||
private void updateZoomedContentWidth() => zoomedContent.Width = DrawWidth * currentZoom;
|
||||
|
Reference in New Issue
Block a user