mirror of
https://github.com/raysan5/raygui.git
synced 2026-02-02 20:29:19 -05:00
GuiSliderPro() returns 1/true if control value changed (#346)
This commit is contained in:
@ -2937,6 +2937,7 @@ int GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, in
|
|||||||
int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth)
|
int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
float oldValue = *value;
|
||||||
GuiState state = guiState;
|
GuiState state = guiState;
|
||||||
|
|
||||||
float temp = (maxValue - minValue)/2.0f;
|
float temp = (maxValue - minValue)/2.0f;
|
||||||
@ -3006,6 +3007,10 @@ int GuiSliderPro(Rectangle bounds, const char *textLeft, const char *textRight,
|
|||||||
else if (*value < minValue) *value = minValue;
|
else if (*value < minValue) *value = minValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Control value change check
|
||||||
|
if(oldValue == *value) result = 0;
|
||||||
|
else result = 1;
|
||||||
|
|
||||||
// Bar limits check
|
// Bar limits check
|
||||||
if (sliderWidth > 0) // Slider
|
if (sliderWidth > 0) // Slider
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user