fix slider cursor pos
parent
7b6d120c10
commit
5bd16646b4
4
MAKE.bat
4
MAKE.bat
|
@ -468,6 +468,10 @@ if "%1"=="fwk_mir" (
|
||||||
)
|
)
|
||||||
|
|
||||||
tools\fwkren.exe _fwk\tools\cook.ini from
|
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.
|
echo All done.
|
||||||
endlocal
|
endlocal
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
int main() {
|
int main() {
|
||||||
window_create(65.0, 0 );
|
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());
|
skinned_t *skinned = C_CAST(skinned_t*, gui_userdata());
|
||||||
|
|
||||||
vec4 pos = vec4(400,400,100, 30);
|
vec4 pos = vec4(400,400,100, 30);
|
||||||
|
|
|
@ -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);
|
*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*.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;
|
vec4 cursorrect = rect;
|
||||||
cursorrect.x += cursorpos.x;
|
cursorrect.x += cursorpos.x;
|
||||||
cursorrect.y += cursorpos.y;
|
cursorrect.y += cursorpos.y;
|
||||||
|
|
|
@ -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*.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;
|
vec4 cursorrect = rect;
|
||||||
cursorrect.x += cursorpos.x;
|
cursorrect.x += cursorpos.x;
|
||||||
cursorrect.y += cursorpos.y;
|
cursorrect.y += cursorpos.y;
|
||||||
|
|
|
@ -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*.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;
|
vec4 cursorrect = rect;
|
||||||
cursorrect.x += cursorpos.x;
|
cursorrect.x += cursorpos.x;
|
||||||
cursorrect.y += cursorpos.y;
|
cursorrect.y += cursorpos.y;
|
||||||
|
|
Loading…
Reference in New Issue