Skip to content

Commit

Permalink
Panel.scrollH clamp logic improvement
Browse files Browse the repository at this point in the history
Fix a logic error in commit 0128d22
(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.
  • Loading branch information
Explorer09 committed Jan 11, 2025
1 parent 4e6a781 commit 4bdca9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4bdca9a

Please sign in to comment.