diff options
Diffstat (limited to 'content/handlers/html/layout_flex.c')
-rw-r--r-- | content/handlers/html/layout_flex.c | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/content/handlers/html/layout_flex.c b/content/handlers/html/layout_flex.c index cea7964d7..a12becf3a 100644 --- a/content/handlers/html/layout_flex.c +++ b/content/handlers/html/layout_flex.c @@ -172,6 +172,38 @@ static struct flex_ctx *layout_flex_ctx__create( } /** + * Find box side representing the start of flex container in main direction. + * + * \param[in] ctx Flex layout context. + * \return the start side. + */ +static enum box_side layout_flex__main_start_side( + const struct flex_ctx *ctx) +{ + if (ctx->horizontal) { + return (ctx->main_reversed) ? RIGHT : LEFT; + } else { + return (ctx->main_reversed) ? BOTTOM : TOP; + } +} + +/** + * Find box side representing the end of flex container in main direction. + * + * \param[in] ctx Flex layout context. + * \return the end side. + */ +static enum box_side layout_flex__main_end_side( + const struct flex_ctx *ctx) +{ + if (ctx->horizontal) { + return (ctx->main_reversed) ? LEFT : RIGHT; + } else { + return (ctx->main_reversed) ? TOP : BOTTOM; + } +} + +/** * Perform layout on a flex item * * \param[in] ctx Flex layout context @@ -738,22 +770,6 @@ static bool layout_flex__resolve_line( } /** - * Find box side representing the start of flex container in main direction. - * - * \param[in] ctx Flex layout context. - * \return the start side. - */ -static enum box_side layout_flex__main_start_side( - const struct flex_ctx *ctx) -{ - if (ctx->horizontal) { - return (ctx->main_reversed) ? RIGHT : LEFT; - } else { - return (ctx->main_reversed) ? BOTTOM : TOP; - } -} - -/** * Position items along a line * * \param[in] ctx Flex layout context |