html: layout helpers: Add helpers for width/height indirection

This commit is contained in:
Michael Drake 2022-10-31 16:07:34 +00:00 committed by Michael Drake
parent 0718e58681
commit 6c2f9f3285

View File

@ -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.
*