summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-19 22:22:03 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-19 22:22:03 +0000
commit5d40458ad550d3a35694167b26f130deae3188e6 (patch)
treef285673a9f0f74e07e47f305cdd83fd0f39a11a4 /amiga/gui.c
parentdd067c9fba4d783f5515b7df19aae418903257a4 (diff)
downloadnetsurf-5d40458ad550d3a35694167b26f130deae3188e6.tar.gz
netsurf-5d40458ad550d3a35694167b26f130deae3188e6.tar.bz2
Auto-scroll on drags beyond window boundaries
svn path=/trunk/netsurf/; revision=10894
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 759b4f932..bcd0c0365 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1012,9 +1012,6 @@ void ami_handle_msg(void)
switch(result & WMHI_CLASSMASK) // class
{
case WMHI_MOUSEMOVE:
- if(drag_icon)
- ami_drag_icon_move(drag_icon);
-
GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
(ULONG *)&bbox);
@@ -1030,6 +1027,32 @@ void ami_handle_msg(void)
width=bbox->Width;
height=bbox->Height;
+ if(gwin->mouse_state & BROWSER_MOUSE_DRAG_ON)
+ {
+ int drag_x_move = 0, drag_y_move = 0;
+
+ ami_drag_icon_move();
+
+ if(gwin->win->MouseX < bbox->Left)
+ drag_x_move = gwin->win->MouseX - bbox->Left;
+ if(gwin->win->MouseX > (bbox->Left + bbox->Width))
+ drag_x_move = gwin->win->MouseX - (bbox->Left + bbox->Width);
+ if(gwin->win->MouseY < bbox->Top)
+ drag_y_move = gwin->win->MouseY - bbox->Top;
+ if(gwin->win->MouseY > (bbox->Top + bbox->Height))
+ 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))
{
ami_update_quals(gwin);