HTML: Box coordinates: Take fast route to float container.
And assert that floats have a float_container.
This commit is contained in:
parent
170dc5d524
commit
be23d522db
|
@ -307,11 +307,11 @@ void box_coords(struct box *box, int *x, int *y)
|
|||
*y = box->y;
|
||||
while (box->parent) {
|
||||
if (box_is_float(box)) {
|
||||
do {
|
||||
box = box->parent;
|
||||
} while (!box->float_children);
|
||||
} else
|
||||
assert(box->float_container);
|
||||
box = box->float_container;
|
||||
} else {
|
||||
box = box->parent;
|
||||
}
|
||||
*x += box->x - scrollbar_get_offset(box->scroll_x);
|
||||
*y += box->y - scrollbar_get_offset(box->scroll_y);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue