mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-06 17:39:45 +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) {
|
||||
int ww = MwGetInteger(handle, MwNwidth);
|
||||
int wh = MwGetInteger(handle, MwNheight);
|
||||
int or = MwGetInteger(handle, MwNorientation);
|
||||
scrollbar_t* scr = handle->internal;
|
||||
|
||||
@@ -144,13 +142,9 @@ static void mouse_move(MwWidget handle) {
|
||||
int max = MwGetInteger(handle, MwNmaxValue);
|
||||
|
||||
if(or == MwVERTICAL) {
|
||||
int tri = (ww - MwDefaultBorderWidth * 2) + MwDefaultBorderWidth;
|
||||
l = handle->mouse_point.y - tri + scr->pos;
|
||||
len -= tri * 2;
|
||||
l = handle->mouse_point.y + scr->pos;
|
||||
} else if(or == MwHORIZONTAL) {
|
||||
int tri = (wh - MwDefaultBorderWidth * 2) + MwDefaultBorderWidth;
|
||||
l = handle->mouse_point.x - tri + scr->pos;
|
||||
len -= tri * 2;
|
||||
l = handle->mouse_point.x + scr->pos;
|
||||
}
|
||||
|
||||
len = l / len;
|
||||
|
||||
Reference in New Issue
Block a user