mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:53:51 +08:00
Don't attempt to render timeline ticks until DrawWidth
is above zero
This commit is contained in:
parent
ccae721af2
commit
e227519b09
@ -77,20 +77,19 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||
{
|
||||
base.Update();
|
||||
|
||||
if (timeline != null)
|
||||
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);
|
||||
|
||||
if (visibleRange != newRange)
|
||||
{
|
||||
var 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);
|
||||
visibleRange = newRange;
|
||||
|
||||
if (visibleRange != newRange)
|
||||
{
|
||||
visibleRange = newRange;
|
||||
|
||||
// actual regeneration only needs to occur if we've passed one of the known next min/max tick boundaries.
|
||||
if (nextMinTick == null || nextMaxTick == null || (visibleRange.min < nextMinTick || visibleRange.max > nextMaxTick))
|
||||
tickCache.Invalidate();
|
||||
}
|
||||
// actual regeneration only needs to occur if we've passed one of the known next min/max tick boundaries.
|
||||
if (nextMinTick == null || nextMaxTick == null || (visibleRange.min < nextMinTick || visibleRange.max > nextMaxTick))
|
||||
tickCache.Invalidate();
|
||||
}
|
||||
|
||||
if (!tickCache.IsValid)
|
||||
|
Loading…
Reference in New Issue
Block a user