From 793bb9119a04a109c2ac55200f0d4a00d026dee0 Mon Sep 17 00:00:00 2001 From: Richard Wilson Date: Fri, 18 Mar 2005 23:50:36 +0000 Subject: [project @ 2005-03-18 23:50:36 by rjw] Take borders into account when checking whether a box contains a point. svn path=/import/netsurf/; revision=1540 --- render/box.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'render') diff --git a/render/box.c b/render/box.c index 3062db501..f5c02eedb 100644 --- a/render/box.c +++ b/render/box.c @@ -3443,11 +3443,11 @@ bool box_contains_point(struct box *box, int x, int y) { if (box->style && box->style->overflow != CSS_OVERFLOW_VISIBLE) { if (box->x <= x && - x < box->x + box->padding[LEFT] + box->width + - box->padding[RIGHT] && + x < box->x + box->padding[LEFT] + box->border[LEFT] +box->width + + box->border[RIGHT] + box->padding[RIGHT] && box->y <= y && - y < box->y + box->padding[TOP] + box->height + - box->padding[BOTTOM]) + y < box->y + box->padding[TOP] + box->border[TOP] + box->height + + box->border[BOTTOM] + box->padding[BOTTOM]) return true; } else { if (box->x + box->descendant_x0 <= x && -- cgit v1.2.3