From da40dfb8246f1029bd8a6b348c9ef9b8d22371f4 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 19 Dec 2025 16:33:25 -0500 Subject: [PATCH] Fix measure ticks drawing beyond the end of the song. --- .../ui/debug/charting/components/ChartEditorMeasureTicks.hx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx b/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx index cf1e2d46f..51abdb842 100644 --- a/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx +++ b/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx @@ -179,9 +179,11 @@ class ChartEditorMeasureTicks extends FlxTypedSpriteGroup var targetMeasure:Int = currentMeasure + i - 1; if (targetMeasure < 0) continue; - // TODO: This math is kinda awkward but DOES account for time signatures, - // might want some cleanup though? Maybe add a `getMeasureTimeInSteps` method? var measureTimeInMs:Float = Conductor.instance.getMeasureTimeInMs(targetMeasure); + + // If we've gone past the end of the song, we're done. + if (measureTimeInMs > chartEditorState.songLengthInMs) break; + var measureTimeInSteps:Float = Conductor.instance.getTimeInSteps(measureTimeInMs); var measureTimeInPixels:Float = measureTimeInSteps * ChartEditorState.GRID_SIZE;