1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 08:43:20 +08:00

Fix timeline zoom focus point when using buttons

This commit is contained in:
Dan Balasescu 2022-07-22 17:03:04 +09:00
parent 72916d708c
commit e1df50c8ff

View File

@ -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();
}