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/box.c | |
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/box.c')
-rw-r--r-- | render/box.c | 16 |
1 files changed, 13 insertions, 3 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; } |