REVIEWED: GuiProgressBar() #192
This commit is contained in:
parent
483b3a17ad
commit
7137b8331d
@ -2558,8 +2558,6 @@ float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight
|
|||||||
// Progress Bar control extended, shows current progress value
|
// Progress Bar control extended, shows current progress value
|
||||||
float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue)
|
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;
|
GuiControlState state = guiState;
|
||||||
|
|
||||||
Rectangle progress = { bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH),
|
Rectangle progress = { bounds.x + GuiGetStyle(PROGRESSBAR, BORDER_WIDTH),
|
||||||
@ -2568,6 +2566,8 @@ float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRig
|
|||||||
|
|
||||||
// Update control
|
// 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)));
|
if (state != GUI_STATE_DISABLED) progress.width = ((float)(value/(maxValue - minValue))*(float)(bounds.width - 2*GuiGetStyle(PROGRESSBAR, BORDER_WIDTH)));
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user