From 3ed712c8b5c5f742e1e7eacdf3356f6eebe6d16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 28 Nov 2023 14:36:44 +0100 Subject: [PATCH] only trigger slider change if changed by user --- engine/joint/v4k.h | 2 +- engine/split/v4k_gui.c | 2 +- engine/v4k.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 0db13d5..ff3794c 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -359080,7 +359080,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return (old_value!=*value); + return entry->held && (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) { diff --git a/engine/split/v4k_gui.c b/engine/split/v4k_gui.c index 508fe43..5d475cd 100644 --- a/engine/split/v4k_gui.c +++ b/engine/split/v4k_gui.c @@ -235,7 +235,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return (old_value!=*value); + return entry->held && (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) { diff --git a/engine/v4k.c b/engine/v4k.c index d6cc169..1e545fa 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -11245,7 +11245,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return (old_value!=*value); + return entry->held && (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) {