diff options
author | James Bursa <james@netsurf-browser.org> | 2004-04-26 13:45:52 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2004-04-26 13:45:52 +0000 |
commit | 330a3bb64c58ff12d8ac7d08de74f3064c670a75 (patch) | |
tree | 197e67f90e9a1044b2dfc96690872c57de2b14a4 /render | |
parent | d44ab700d065a5ac859df24969a4d993cee122ec (diff) | |
download | netsurf-330a3bb64c58ff12d8ac7d08de74f3064c670a75.tar.gz netsurf-330a3bb64c58ff12d8ac7d08de74f3064c670a75.tar.bz2 |
[project @ 2004-04-26 13:45:52 by bursa]
Fix box_coords().
svn path=/import/netsurf/; revision=804
Diffstat (limited to 'render')
-rw-r--r-- | render/box.c | 16 | ||||
-rw-r--r-- | render/box.h | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/render/box.c b/render/box.c index c7edf9e7e..5ba11d26f 100644 --- a/render/box.c +++ b/render/box.c @@ -2281,14 +2281,24 @@ bool plugin_decode(struct content* content, char* url, struct box* box, /** * Find the absolute coordinates of a box. + * + * \param box the box to calculate coordinates of + * \param x updated to x coordinate + * \param y updated to y coordinate */ -void box_coords(struct box *box, unsigned long *x, unsigned long *y) +void box_coords(struct box *box, int *x, int *y) { *x = box->x; *y = box->y; - while (box->parent != 0) { - box = box->parent; + while (box->parent) { + if (box->type == BOX_FLOAT_LEFT || + box->type == BOX_FLOAT_RIGHT) { + do { + box = box->parent; + } while (!box->float_children); + } else + box = box->parent; *x += box->x; *y += box->y; } diff --git a/render/box.h b/render/box.h index d807e430c..0b1831c6f 100644 --- a/render/box.h +++ b/render/box.h @@ -212,6 +212,6 @@ struct box * box_create(struct css_style * style, void box_add_child(struct box * parent, struct box * child); void box_insert_sibling(struct box *box, struct box *new_box); void box_free(struct box *box); -void box_coords(struct box *box, unsigned long *x, unsigned long *y); +void box_coords(struct box *box, int *x, int *y); #endif |