From 4466262b50dd71b9d2618ca89749e18cd0802e8a Mon Sep 17 00:00:00 2001 From: boukew99 <49942484+boukew99@users.noreply.github.com> Date: Mon, 28 Mar 2022 13:30:06 +0200 Subject: [PATCH] add max to GuiProgressBar (#190) Progressbar cannot visualy overflow anymore and returning value has meaning now. I considered adding min, but have not needed it yet. --- src/raygui.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index 34a479f..a3ef41b 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -2558,6 +2558,8 @@ float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight // Progress Bar control extended, shows current progress value float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue) { + if (value > maxValue) value = maxValue // max + GuiControlState state = guiState; Rectangle progress = { bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH),