diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
index 706a9f3d30..a33040f400 100644
--- a/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
+++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/Timeline.cs
@@ -30,10 +30,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
ZoomDuration = 200;
ZoomEasing = Easing.OutQuint;
-
- Zoom = 60;
- MaxZoom = 240;
-
ScrollbarVisible = false;
}
@@ -64,9 +60,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
waveform.Waveform = b.NewValue.Waveform;
track = b.NewValue.Track;
+
+ MinZoom = getZoomLevelForVisibleMilliseconds(10000);
+ MaxZoom = getZoomLevelForVisibleMilliseconds(500);
+ Zoom = getZoomLevelForVisibleMilliseconds(2000);
}, true);
}
+ private float getZoomLevelForVisibleMilliseconds(double milliseconds) => (float)(track.Length / milliseconds);
+
///
/// The timeline's scroll position in the last frame.
///
diff --git a/osu.Game/Screens/Edit/Compose/Components/Timeline/ZoomableScrollContainer.cs b/osu.Game/Screens/Edit/Compose/Components/Timeline/ZoomableScrollContainer.cs
index 9aa527667b..7ce8a751e0 100644
--- a/osu.Game/Screens/Edit/Compose/Components/Timeline/ZoomableScrollContainer.cs
+++ b/osu.Game/Screens/Edit/Compose/Components/Timeline/ZoomableScrollContainer.cs
@@ -36,12 +36,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
base.Content.Add(zoomedContent = new Container { RelativeSizeAxes = Axes.Y });
}
- private int minZoom = 1;
+ private float minZoom = 1;
///
/// The minimum zoom level allowed.
///
- public int MinZoom
+ public float MinZoom
{
get => minZoom;
set
@@ -56,12 +56,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}
}
- private int maxZoom = 60;
+ private float maxZoom = 60;
///
/// The maximum zoom level allowed.
///
- public int MaxZoom
+ public float MaxZoom
{
get => maxZoom;
set