improve sliders

main
Dominik Madarász 2023-11-28 14:34:34 +01:00
parent 31acdce47d
commit 2b0e522adf
4 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -359072,7 +359072,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl
*value = posx2slider(usablerect, min, max, input(MOUSE_X), step); *value = posx2slider(usablerect, min, max, input(MOUSE_X), step);
} }
float sliderx = slider2posx(min, max, *value, step, usablerect.z); float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect; vec4 cursorrect = rect;
cursorrect.x += cursorpos.x; cursorrect.x += cursorpos.x;
cursorrect.y += cursorpos.y; cursorrect.y += cursorpos.y;

View File

@ -227,7 +227,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl
*value = posx2slider(usablerect, min, max, input(MOUSE_X), step); *value = posx2slider(usablerect, min, max, input(MOUSE_X), step);
} }
float sliderx = slider2posx(min, max, *value, step, usablerect.z); float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect; vec4 cursorrect = rect;
cursorrect.x += cursorpos.x; cursorrect.x += cursorpos.x;
cursorrect.y += cursorpos.y; cursorrect.y += cursorpos.y;

View File

@ -11237,7 +11237,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl
*value = posx2slider(usablerect, min, max, input(MOUSE_X), step); *value = posx2slider(usablerect, min, max, input(MOUSE_X), step);
} }
float sliderx = slider2posx(min, max, *value, step, usablerect.z); float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f)); vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect; vec4 cursorrect = rect;
cursorrect.x += cursorpos.x; cursorrect.x += cursorpos.x;
cursorrect.y += cursorpos.y; cursorrect.y += cursorpos.y;