mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 10:02:59 +08:00
Standardise editor timeline zoom across maps of all lengths
This commit is contained in:
parent
01cf417569
commit
4bb33046ca
@ -30,7 +30,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
{
|
{
|
||||||
ZoomDuration = 200;
|
ZoomDuration = 200;
|
||||||
ZoomEasing = Easing.OutQuint;
|
ZoomEasing = Easing.OutQuint;
|
||||||
Zoom = 10;
|
|
||||||
ScrollbarVisible = false;
|
ScrollbarVisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,9 +60,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
{
|
{
|
||||||
waveform.Waveform = b.NewValue.Waveform;
|
waveform.Waveform = b.NewValue.Waveform;
|
||||||
track = b.NewValue.Track;
|
track = b.NewValue.Track;
|
||||||
|
|
||||||
|
MinZoom = getZoomLevelForVisibleMilliseconds(10000);
|
||||||
|
MaxZoom = getZoomLevelForVisibleMilliseconds(500);
|
||||||
|
Zoom = getZoomLevelForVisibleMilliseconds(2000);
|
||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private float getZoomLevelForVisibleMilliseconds(double milliseconds) => (float)(track.Length / milliseconds);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The timeline's scroll position in the last frame.
|
/// The timeline's scroll position in the last frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -36,12 +36,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
base.Content.Add(zoomedContent = new Container { RelativeSizeAxes = Axes.Y });
|
base.Content.Add(zoomedContent = new Container { RelativeSizeAxes = Axes.Y });
|
||||||
}
|
}
|
||||||
|
|
||||||
private int minZoom = 1;
|
private float minZoom = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The minimum zoom level allowed.
|
/// The minimum zoom level allowed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MinZoom
|
public float MinZoom
|
||||||
{
|
{
|
||||||
get => minZoom;
|
get => minZoom;
|
||||||
set
|
set
|
||||||
@ -56,12 +56,12 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int maxZoom = 60;
|
private float maxZoom = 60;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum zoom level allowed.
|
/// The maximum zoom level allowed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int MaxZoom
|
public float MaxZoom
|
||||||
{
|
{
|
||||||
get => maxZoom;
|
get => maxZoom;
|
||||||
set
|
set
|
||||||
|
Loading…
Reference in New Issue
Block a user