From 7137b8331da889b4e811825ac189fe57008be748 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 29 Mar 2022 17:25:49 +0200 Subject: [PATCH] REVIEWED: GuiProgressBar() #192 --- src/raygui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/raygui.h b/src/raygui.h index 1de5a55..cba7710 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -2558,8 +2558,6 @@ 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), @@ -2568,6 +2566,8 @@ float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRig // Update control //-------------------------------------------------------------------- + if (value > maxValue) value = maxValue; + if (state != GUI_STATE_DISABLED) progress.width = ((float)(value/(maxValue - minValue))*(float)(bounds.width - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH))); //--------------------------------------------------------------------