From 4bdca9a1a2312341b0a46b56c682036aae7c1d3f Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sun, 12 Jan 2025 03:40:59 +0800 Subject: [PATCH] Panel.scrollH clamp logic improvement Fix a logic error in commit 0128d222b94adab6b258f417722f298013a33327 (This error is not triggerable by the user.) The Panel.scrollH value is supposed to have a minimum value of 0 in the KEY_LEFT event. --- Panel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Panel.c b/Panel.c index 4784a6585..c55febf87 100644 --- a/Panel.c +++ b/Panel.c @@ -378,7 +378,7 @@ bool Panel_onKey(Panel* this, int key) { case KEY_LEFT: case KEY_CTRL('B'): if (this->scrollH > 0) { - this->scrollH -= MAXIMUM(CRT_scrollHAmount, 0); + this->scrollH = MAXIMUM(this->scrollH - CRT_scrollHAmount, 0); this->needsRedraw = true; } break;