From a81b6b2d6e979b3ab5c680f33b846277f3557ab7 Mon Sep 17 00:00:00 2001
From: EliteMasterEric <ericmyllyoja@gmail.com>
Date: Thu, 6 Jun 2024 16:44:20 -0400
Subject: [PATCH] Fix issue with rendering the grid in 3/4 time signature

---
 source/funkin/play/GameOverSubState.hx                         | 2 +-
 source/funkin/play/components/HealthIcon.hx                    | 3 ++-
 .../ui/debug/charting/handlers/ChartEditorThemeHandler.hx      | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx
index 4d50d75cc..ac45dc194 100644
--- a/source/funkin/play/GameOverSubState.hx
+++ b/source/funkin/play/GameOverSubState.hx
@@ -237,7 +237,7 @@ class GameOverSubState extends MusicBeatSubState
     }
 
     // KEYBOARD ONLY: Restart the level when pressing the assigned key.
-    if (controls.ACCEPT && blueballed)
+    if (controls.ACCEPT && blueballed && !mustNotExit)
     {
       blueballed = false;
       confirmDeath();
diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx
index a3204329a..2442b0dc5 100644
--- a/source/funkin/play/components/HealthIcon.hx
+++ b/source/funkin/play/components/HealthIcon.hx
@@ -53,8 +53,9 @@ class HealthIcon extends FunkinSprite
 
   /**
    * Apply the "bop" animation once every X steps.
+   * Defaults to once per beat.
    */
-  public var bopEvery:Int = 4;
+  public var bopEvery:Int = Constants.STEPS_PER_BEAT;
 
   /**
    * The amount, in degrees, to rotate the icon by when boping.
diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorThemeHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorThemeHandler.hx
index b1af0ce4c..e42102a52 100644
--- a/source/funkin/ui/debug/charting/handlers/ChartEditorThemeHandler.hx
+++ b/source/funkin/ui/debug/charting/handlers/ChartEditorThemeHandler.hx
@@ -201,7 +201,8 @@ class ChartEditorThemeHandler
     // Selection borders horizontally in the middle.
     for (i in 1...(Conductor.instance.stepsPerMeasure))
     {
-      if ((i % Conductor.instance.beatsPerMeasure) == 0)
+      // There may be a different number of beats per measure, but there's always 4 steps per beat.
+      if ((i % Constants.STEPS_PER_BEAT) == 0)
       {
         state.gridBitmap.fillRect(new Rectangle(0, (ChartEditorState.GRID_SIZE * i) - (GRID_BEAT_DIVIDER_WIDTH / 2), state.gridBitmap.width,
           GRID_BEAT_DIVIDER_WIDTH),