summaryrefslogtreecommitdiff
path: root/amiga/tree.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-25 17:26:34 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-10-25 17:26:34 +0000
commitc07c79cc5e54d7faee8dadb40140c05e92f375d1 (patch)
treea987f9609b84b05a34eb300acfbd09918731dfca /amiga/tree.c
parent3529ead319289f4effe798c9bee0da3f48d5c5b5 (diff)
downloadnetsurf-c07c79cc5e54d7faee8dadb40140c05e92f375d1.tar.gz
netsurf-c07c79cc5e54d7faee8dadb40140c05e92f375d1.tar.bz2
Don't feed negative values to the scroller
svn path=/trunk/netsurf/; revision=10909
Diffstat (limited to 'amiga/tree.c')
-rwxr-xr-xamiga/tree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/amiga/tree.c b/amiga/tree.c
index f39df7285..7b91b78e9 100755
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -248,12 +248,18 @@ void ami_tree_scroll(struct treeview_window *twin, int sx, int sy)
GetAttr(SCROLLER_Top, twin->objects[OID_HSCROLL], (ULONG *)&x);
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y);
+ x += sx;
+ y += sy;
+
+ if(y < 0) y = 0;
+ if(x < 0) x = 0;
+
RefreshSetGadgetAttrs((APTR)twin->objects[OID_VSCROLL], twin->win, NULL,
- SCROLLER_Top, y + sy,
+ SCROLLER_Top, y,
TAG_DONE);
RefreshSetGadgetAttrs((APTR)twin->objects[OID_HSCROLL], twin->win, NULL,
- SCROLLER_Top, x + sx,
+ SCROLLER_Top, x,
TAG_DONE);
ami_tree_draw(twin);