From 37be6ce4e8ff0586ee9ea2cabe8c725e7440324a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 22 Oct 2026 09:03:18 +0200 Subject: [PATCH] Config: Clamp the touch layout snap grid size on load The layout editor divides by it, and drawing the grid never finishes when it's 0. Only the slider limited it, so a hand-edited ini could hang. Co-Authored-By: Claude Opus 5.5 (1M context) --- Core/Config.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/Config.cpp b/Core/Config.cpp index 45525140f0..ab7a631017 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1666,6 +1666,9 @@ void Config::PostLoadCleanup() { // Three frames in flight showed no benefit over two, so the option is gone. Squash old values. iInflightFrames = std::clamp(iInflightFrames, 1, 2); + + // The touch layout editor divides by this, and loops forever drawing the grid if it's 0. + iTouchSnapGridSize = std::clamp(iTouchSnapGridSize, 2, 256); } void Config::PreSaveCleanup() {