projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
447461c
)
fixed input of negative numbers to numeric text gadgets
author
Holger Schemel
<info@artsoft.org>
Wed, 13 Mar 2024 09:08:06 +0000
(10:08 +0100)
committer
Holger Schemel
<info@artsoft.org>
Wed, 13 Mar 2024 09:08:08 +0000
(10:08 +0100)
src/libgame/gadgets.c
patch
|
blob
|
history
diff --git
a/src/libgame/gadgets.c
b/src/libgame/gadgets.c
index 64637dc4c6220ca99361d1a27b38166c81dd5a9f..844f4f4e9c527fe8025cd3a38665298bb9da4a3c 100644
(file)
--- a/
src/libgame/gadgets.c
+++ b/
src/libgame/gadgets.c
@@
-2455,8
+2455,7
@@
boolean HandleGadgetsKeyInput(Key key)
int cursor_pos = gi->textinput.cursor_position;
char letter = getCharFromKey(key);
boolean legal_letter = (gi->type == GD_TYPE_TEXT_INPUT_NUMERIC ?
- letter >= '0' && letter <= '9' :
- letter != 0);
+ (letter >= '0' && letter <= '9') || letter == '-' : letter != 0);
if (legal_letter && text_length < gi->textinput.size)
{