1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Fix potentially incorrect zoom level getting set on very short audio

track
This commit is contained in:
Dean Herbert 2020-08-24 20:00:24 +09:00
parent bb97e9632c
commit d1f79a6a48

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}, true);
}
private float getZoomLevelForVisibleMilliseconds(double milliseconds) => (float)(track.Length / milliseconds);
private float getZoomLevelForVisibleMilliseconds(double milliseconds) => Math.Max(1, (float)(track.Length / milliseconds));
/// <summary>
/// The timeline's scroll position in the last frame.