summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-06-26 20:16:24 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-06-26 20:16:24 +0000
commit58dc86655ec31f142f8df62e134680be181a481e (patch)
tree941eea67b44d99807d2450bf9f3b9045a30d4548
parent553d6066d07cf08c10e1ba41970ebf7a88e889bd (diff)
downloadnetsurf-58dc86655ec31f142f8df62e134680be181a481e.tar.gz
netsurf-58dc86655ec31f142f8df62e134680be181a481e.tar.bz2
Make box_at_point detection consider absolute children too
svn path=/trunk/netsurf/; revision=2651
-rw-r--r--render/box.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/render/box.c b/render/box.c
index 684a4da92..f31b636ec 100644
--- a/render/box.c
+++ b/render/box.c
@@ -211,7 +211,7 @@ void box_free(struct box *box)
next = child->next;
box_free(child);
}
-
+
for (child = box->absolute_children; child; child = next) {
next = child->next;
box_free(child);
@@ -331,7 +331,16 @@ struct box *box_at_point(struct box *box, int x, int y,
}
}
- /* consider floats first, since they will often overlap other boxes */
+ /* consider absolute children first */
+ for (child = box->absolute_children; child; child = child->next) {
+ if (box_contains_point(child, x - bx, y - by)) {
+ *box_x = bx + child->x - child->scroll_x;
+ *box_y = by + child->y - child->scroll_y;
+ return child;
+ }
+ }
+
+ /* consider floats second, since they will often overlap other boxes */
for (child = box->float_children; child; child = child->next_float) {
if (box_contains_point(child, x - bx, y - by)) {
*box_x = bx + child->x - child->scroll_x;