mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Merge pull request #19296 from smoogipoo/fix-timeline-focus-point
Fix timeline zoom focus point when using zoom buttons
This commit is contained in:
commit
bfafb4480e
@ -157,7 +157,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
private void setZoomTarget(float newZoom, float? focusPoint = null)
|
||||
{
|
||||
zoomTarget = Math.Clamp(newZoom, MinZoom, MaxZoom);
|
||||
transformZoomTo(zoomTarget, focusPoint ?? DrawWidth / 2, ZoomDuration, ZoomEasing);
|
||||
focusPoint ??= zoomedContent.ToLocalSpace(ToScreenSpace(new Vector2(DrawWidth / 2, 0))).X;
|
||||
|
||||
transformZoomTo(zoomTarget, focusPoint.Value, ZoomDuration, ZoomEasing);
|
||||
|
||||
OnZoomChanged();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user