diff options
| author | Yuri Kobets <yuri.kobets@gmail.com> | 2024-01-09 02:44:04 +0300 |
|---|---|---|
| committer | Yuri Kobets <yuri.kobets@gmail.com> | 2024-01-09 02:44:04 +0300 |
| commit | b6e60a680353eb2bf83be9cb6d024068c97b976a (patch) | |
| tree | a0beb79780507aaf9f28773f61716a90414a7c9a /src/render_block_context.cpp | |
| parent | f5cdc4f24087ee68f3bad3ffbc1cd28cc9a3f4ad (diff) | |
flex: added support for align-items: baseline
Diffstat (limited to 'src/render_block_context.cpp')
| -rw-r--r-- | src/render_block_context.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/render_block_context.cpp b/src/render_block_context.cpp index c94bc566..bf6b0927 100644 --- a/src/render_block_context.cpp +++ b/src/render_block_context.cpp @@ -132,3 +132,23 @@ int litehtml::render_item_block_context::_render_content(int x, int y, bool seco return ret_width; } + +int litehtml::render_item_block_context::get_first_baseline() +{ + if(m_children.empty()) + { + return height() - margin_bottom(); + } + const auto &item = m_children.front(); + return content_offset_top() + item->top() + item->get_first_baseline(); +} + +int litehtml::render_item_block_context::get_last_baseline() +{ + if(m_children.empty()) + { + return height() - margin_bottom(); + } + const auto &item = m_children.back(); + return content_offset_top() + item->top() + item->get_last_baseline(); +} |
