From 58dc86655ec31f142f8df62e134680be181a481e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 26 Jun 2006 20:16:24 +0000 Subject: Make box_at_point detection consider absolute children too svn path=/trunk/netsurf/; revision=2651 --- render/box.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'render/box.c') 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; -- cgit v1.2.3