fix slider cursor pos

main
Dominik Madarász 2023-11-28 15:38:30 +01:00
parent 7b6d120c10
commit 5bd16646b4
5 changed files with 8 additions and 4 deletions

View File

@ -468,6 +468,10 @@ if "%1"=="fwk_mir" (
)
tools\fwkren.exe _fwk\tools\cook.ini from
tools\fwkren.exe _fwk\engine\v4k.c from
tools\fwkren.exe _fwk\engine\v4k.h from
move _fwk\engine\v4k.h _fwk\engine\fwk.h
move _fwk\engine\v4k.c _fwk\engine\fwk.c
echo All done.
endlocal

View File

@ -3,7 +3,7 @@
int main() {
window_create(65.0, 0 );
gui_pushskin(gui_skinned("golden.ase", 4.0f));
gui_pushskin(gui_skinned("golden.ase", 1.0f));
skinned_t *skinned = C_CAST(skinned_t*, gui_userdata());
vec4 pos = vec4(400,400,100, 30);

View File

@ -359089,7 +359089,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);
}
float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect;
cursorrect.x += cursorpos.x;
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);
}
float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect;
cursorrect.x += cursorpos.x;
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);
}
float sliderx = slider2posx(min, max, *value, step, usablerect.z);
vec2 cursorpos = vec2(sliderx+usablerect.x*.5f-cursorsize.x*.75f, (slidersize.y*.5f - cursorsize.y*.5f));
vec2 cursorpos = vec2(sliderx+(usablerect.x-rect.x)-cursorsize.x*.5f, (slidersize.y*.5f - cursorsize.y*.5f));
vec4 cursorrect = rect;
cursorrect.x += cursorpos.x;
cursorrect.y += cursorpos.y;