HTML: Box coordinates: Take fast route to float container.

And assert that floats have a float_container.
This commit is contained in:
Michael Drake 2019-08-05 21:14:27 +01:00
parent 170dc5d524
commit be23d522db
1 changed files with 4 additions and 4 deletions

View File

@ -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);
}