Fixed bounds check so that out of bounds values don't persist until the next call to GuiValueBox (#165)
This commit is contained in:
parent
65a82bfe54
commit
acc19b74b3
@ -2184,6 +2184,9 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i
|
||||
|
||||
if (valueHasChanged) *value = TextToInteger(textValue);
|
||||
|
||||
if (*value > maxValue) *value = maxValue;
|
||||
else if (*value < minValue) *value = minValue;
|
||||
|
||||
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true;
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user