mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-29 02:09:17 -05:00
REVIEWED: GuiValueBox() values clamp
This commit is contained in:
@ -2202,8 +2202,9 @@ bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, i
|
|||||||
|
|
||||||
if (valueHasChanged) *value = TextToInteger(textValue);
|
if (valueHasChanged) *value = TextToInteger(textValue);
|
||||||
|
|
||||||
if (*value > maxValue) *value = maxValue;
|
// NOTE: We are not clamp values until user input finishes
|
||||||
else if (*value < minValue) *value = minValue;
|
//if (*value > maxValue) *value = maxValue;
|
||||||
|
//else if (*value < minValue) *value = minValue;
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true;
|
if (IsKeyPressed(KEY_ENTER) || (!CheckCollisionPointRec(mousePoint, bounds) && IsMouseButtonPressed(MOUSE_LEFT_BUTTON))) pressed = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user