summaryrefslogtreecommitdiff
path: root/render/box.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-09-03 17:52:45 +0000
committerJames Bursa <james@netsurf-browser.org>2003-09-03 17:52:45 +0000
commite851bbcf37cc72afe07d1294331abb636272064a (patch)
tree62abba013c162df0deb6748813f3c0782077a4e6 /render/box.c
parentcdf0601420e087afd14aabca4b00224b59f0660a (diff)
downloadnetsurf-e851bbcf37cc72afe07d1294331abb636272064a.tar.gz
netsurf-e851bbcf37cc72afe07d1294331abb636272064a.tar.bz2
[project @ 2003-09-03 17:52:45 by bursa]
Add box_coords(). svn path=/import/netsurf/; revision=264
Diffstat (limited to 'render/box.c')
-rw-r--r--render/box.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/render/box.c b/render/box.c
index 256b5c0bf..e13282e9b 100644
--- a/render/box.c
+++ b/render/box.c
@@ -1832,3 +1832,19 @@ bool plugin_decode(struct content* content, char* url, struct box* box,
return true;
}
+
+/**
+ * Find the absolute coordinates of a box.
+ */
+
+void box_coords(struct box *box, unsigned long *x, unsigned long *y)
+{
+ *x = box->x;
+ *y = box->y;
+ while (box->parent != 0) {
+ box = box->parent;
+ *x += box->x;
+ *y += box->y;
+ }
+}
+