Forráskód Böngészése

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.
boukew99 3 éve
szülő
commit
4466262b50
1 módosított fájl, 2 hozzáadás és 0 törlés
  1. 2 0
      src/raygui.h

+ 2 - 0
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
 // 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),