diff options
| author | Yuri Kobets <yuri.kobets@gmail.com> | 2023-05-05 03:31:05 +0300 |
|---|---|---|
| committer | Yuri Kobets <yuri.kobets@gmail.com> | 2023-05-05 03:31:05 +0300 |
| commit | 46bbc0a98e6e373552b12ede9d6150f0435bb23c (patch) | |
| tree | c8db5df1a41c354ac50a646c7615d26175ba0aaa /src/render_block_context.cpp | |
| parent | 34a09af7574cccfb3aeb91abd22ae6c2f0e9a04d (diff) | |
Fixed rendered document size calculating.
document::height() now returns minimum height. This was used in the
render_test.cpp to find the bitmap height. Most of tests were updated
to to match real document size.
Also added ACID1 test.
Diffstat (limited to 'src/render_block_context.cpp')
| -rw-r--r-- | src/render_block_context.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/render_block_context.cpp b/src/render_block_context.cpp index 28c62541..14003488 100644 --- a/src/render_block_context.cpp +++ b/src/render_block_context.cpp @@ -9,6 +9,7 @@ int litehtml::render_item_block_context::_render_content(int x, int y, int max_w int child_top = 0; int last_margin = 0; + std::shared_ptr<render_item> last_margin_el; bool is_first = true; for (const auto& el : m_children) { @@ -83,6 +84,7 @@ int litehtml::render_item_block_context::_render_content(int x, int y, int max_w } child_top += el->height(); last_margin = el->get_margins().bottom; + last_margin_el = el; is_first = false; if (el->src_el()->css().get_position() == element_position_relative) @@ -107,6 +109,10 @@ int litehtml::render_item_block_context::_render_content(int x, int y, int max_w { m_margins.bottom = last_margin; } + if(last_margin_el) + { + last_margin_el->get_margins().bottom = 0; + } } } |
