From 499e8bf7b1d9b0a92af8f685e646bc61f13c6dff Mon Sep 17 00:00:00 2001 From: RadsammyT <32146976+RadsammyT@users.noreply.github.com> Date: Fri, 13 Oct 2023 05:10:34 -0400 Subject: [PATCH] `GuiSliderPro()` returns 1/true if control value changed (#346) --- src/raygui.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index 8e73906..db7f407 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -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 result = 0; + float oldValue = *value; GuiState state = guiState; 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; } + // Control value change check + if(oldValue == *value) result = 0; + else result = 1; + // Bar limits check if (sliderWidth > 0) // Slider {