mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-08 02:13:29 +00:00
better scrollbar handling
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@199 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -130,8 +130,6 @@ static void draw(MwWidget handle) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mouse_move(MwWidget handle) {
|
static void mouse_move(MwWidget handle) {
|
||||||
int ww = MwGetInteger(handle, MwNwidth);
|
|
||||||
int wh = MwGetInteger(handle, MwNheight);
|
|
||||||
int or = MwGetInteger(handle, MwNorientation);
|
int or = MwGetInteger(handle, MwNorientation);
|
||||||
scrollbar_t* scr = handle->internal;
|
scrollbar_t* scr = handle->internal;
|
||||||
|
|
||||||
@@ -144,13 +142,9 @@ static void mouse_move(MwWidget handle) {
|
|||||||
int max = MwGetInteger(handle, MwNmaxValue);
|
int max = MwGetInteger(handle, MwNmaxValue);
|
||||||
|
|
||||||
if(or == MwVERTICAL) {
|
if(or == MwVERTICAL) {
|
||||||
int tri = (ww - MwDefaultBorderWidth * 2) + MwDefaultBorderWidth;
|
l = handle->mouse_point.y + scr->pos;
|
||||||
l = handle->mouse_point.y - tri + scr->pos;
|
|
||||||
len -= tri * 2;
|
|
||||||
} else if(or == MwHORIZONTAL) {
|
} else if(or == MwHORIZONTAL) {
|
||||||
int tri = (wh - MwDefaultBorderWidth * 2) + MwDefaultBorderWidth;
|
l = handle->mouse_point.x + scr->pos;
|
||||||
l = handle->mouse_point.x - tri + scr->pos;
|
|
||||||
len -= tri * 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
len = l / len;
|
len = l / len;
|
||||||
|
|||||||
Reference in New Issue
Block a user