summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-12-18 23:34:56 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-12-18 23:34:56 +0000
commitde5cbf9ee4db1d19fab26781d0ead82f5a001e52 (patch)
tree73ad0d24b2e138ad63193900f245e26dfa8c63c0 /amiga/gui.c
parent75c82c33e6f5c2cdf8f13d213bcd96223a0839af (diff)
downloadnetsurf-de5cbf9ee4db1d19fab26781d0ead82f5a001e52.tar.gz
netsurf-de5cbf9ee4db1d19fab26781d0ead82f5a001e52.tar.bz2
Make drag scrolls work more reliably and only within 10px of render area
svn path=/trunk/netsurf/; revision=11093
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index f3ef8e68d..9a57cd17d 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -864,6 +864,7 @@ void ami_handle_msg(void)
int i, nskey;
struct browser_window *closedbw;
struct timeval curtime;
+ static int drag_x_move = 0, drag_y_move = 0;
if(IsMinListEmpty(window_list))
{
@@ -1007,6 +1008,9 @@ void ami_handle_msg(void)
switch(result & WMHI_CLASSMASK) // class
{
case WMHI_MOUSEMOVE:
+ drag_x_move = 0;
+ drag_y_move = 0;
+
GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
(ULONG *)&bbox);
@@ -1026,28 +1030,20 @@ void ami_handle_msg(void)
((gwin->bw->drag_type == DRAGGING_SELECTION) ||
ami_autoscroll == TRUE))
{
- int drag_x_move = 0, drag_y_move = 0;
-
ami_drag_icon_move();
- if(gwin->win->MouseX < bbox->Left)
+ if((gwin->win->MouseX < bbox->Left) &&
+ ((gwin->win->MouseX - bbox->Left) > -AMI_DRAG_THRESHOLD))
drag_x_move = gwin->win->MouseX - bbox->Left;
- if(gwin->win->MouseX > (bbox->Left + bbox->Width))
+ if((gwin->win->MouseX > (bbox->Left + bbox->Width)) &&
+ ((gwin->win->MouseX - (bbox->Left + bbox->Width)) < AMI_DRAG_THRESHOLD))
drag_x_move = gwin->win->MouseX - (bbox->Left + bbox->Width);
- if(gwin->win->MouseY < bbox->Top)
+ if((gwin->win->MouseY < bbox->Top) &&
+ ((gwin->win->MouseY - bbox->Top) > -AMI_DRAG_THRESHOLD))
drag_y_move = gwin->win->MouseY - bbox->Top;
- if(gwin->win->MouseY > (bbox->Top + bbox->Height))
+ if((gwin->win->MouseY > (bbox->Top + bbox->Height)) &&
+ ((gwin->win->MouseY - (bbox->Top + bbox->Height)) < AMI_DRAG_THRESHOLD))
drag_y_move = gwin->win->MouseY - (bbox->Top + bbox->Height);
-
- if(drag_x_move || drag_y_move)
- {
- gui_window_get_scroll(gwin->bw->window,
- &gwin->bw->window->scrollx, &gwin->bw->window->scrolly);
-
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx + drag_x_move,
- gwin->bw->window->scrolly + drag_y_move);
- }
}
if((x>=xs) && (y>=ys) && (x<width+xs) && (y<height+ys))
@@ -1607,6 +1603,16 @@ void ami_handle_msg(void)
return;
}
+ if(drag_x_move || drag_y_move)
+ {
+ gui_window_get_scroll(gwin->bw->window,
+ &gwin->bw->window->scrollx, &gwin->bw->window->scrolly);
+
+ gui_window_set_scroll(gwin->bw->window,
+ gwin->bw->window->scrollx + drag_x_move,
+ gwin->bw->window->scrolly + drag_y_move);
+ }
+
// ReplyMsg((struct Message *)message);
}