1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Don't attempt to render timeline ticks until DrawWidth is above zero

This commit is contained in:
Dean Herbert 2022-09-27 17:18:45 +09:00
parent ccae721af2
commit e227519b09

View File

@ -77,9 +77,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
base.Update();
if (timeline != null)
{
var newRange = (
if (timeline == null || !(DrawWidth > 0)) return;
(float, float) newRange = (
(ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopLeft).X - PointVisualisation.MAX_WIDTH * 2) / DrawWidth * Content.RelativeChildSize.X,
(ToLocalSpace(timeline.ScreenSpaceDrawQuad.TopRight).X + PointVisualisation.MAX_WIDTH * 2) / DrawWidth * Content.RelativeChildSize.X);
@ -91,7 +91,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
if (nextMinTick == null || nextMaxTick == null || (visibleRange.min < nextMinTick || visibleRange.max > nextMaxTick))
tickCache.Invalidate();
}
}
if (!tickCache.IsValid)
createTicks();