diff --git a/src/raygui.h b/src/raygui.h index da231eb..9bc0132 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -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