summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-10-31 16:07:34 +0000
committerMichael Drake <mdrake.unique@gmail.com>2022-11-02 20:16:41 +0000
commit6c2f9f32853c6359516f643ce8f2b4fad968e058 (patch)
tree21b0afd7b414ac62624006d4dd7d041843a8f251 /content/handlers/html
parent0718e5868119c9f61a6c6f1fe11de21ff6ba9b9a (diff)
downloadnetsurf-6c2f9f32853c6359516f643ce8f2b4fad968e058.tar.gz
netsurf-6c2f9f32853c6359516f643ce8f2b4fad968e058.tar.bz2
html: layout helpers: Add helpers for width/height indirection
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/layout_internal.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/handlers/html/layout_internal.h b/content/handlers/html/layout_internal.h
index 445b43051..8751700b5 100644
--- a/content/handlers/html/layout_internal.h
+++ b/content/handlers/html/layout_internal.h
@@ -231,6 +231,20 @@ static inline int lh__delta_outer_cross(
}
}
+static inline int *lh__box_size_main(
+ bool horizontal,
+ struct box *b)
+{
+ return horizontal ? &b->width : &b->height;
+}
+
+static inline int *lh__box_size_cross(
+ bool horizontal,
+ struct box *b)
+{
+ return horizontal ? &b->height : &b->width;
+}
+
/**
* Determine width of margin, borders, and padding on one side of a box.
*