From 35919374e3d303132c430b1440986055480f095c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 22 Oct 2023 11:43:58 -0700 Subject: [PATCH] backport a bugfix from driver.love Zooming out too far shouldn't crash the app. --- 0023-on.keychord_press | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/0023-on.keychord_press b/0023-on.keychord_press index 6b6427b..0d80349 100644 --- a/0023-on.keychord_press +++ b/0023-on.keychord_press @@ -6,8 +6,10 @@ on.keychord_press = function(chord, key) B() elseif chord == 'C--' then -- zoom out - Viewport.zoom = Viewport.zoom-0.1 - B() + if (Viewport.zoom-0.1)*20 >= 1 then -- disallow font size of 0 + Viewport.zoom = Viewport.zoom-0.1 + B() + end elseif chord == 'C-0' then -- reset zoom Viewport.zoom = 1.0