diff options
author | Yuri Kobets <[email protected]> | 2025-06-10 01:46:11 +0300 |
---|---|---|
committer | Yuri Kobets <[email protected]> | 2025-06-10 01:46:11 +0300 |
commit | 6f36dd247277a98a3eaa82c65efc112044c19898 (patch) | |
tree | b8e5a9d76e2ca9d8cbb2c3111260335c97596120 | |
parent | bfcca39e24c3f24f023dd609daace7d4d1879452 (diff) |
Add const qualifier to calc_document_size methodupstream/overflow_scroll
-rw-r--r-- | include/litehtml/render_item.h | 2 | ||||
-rw-r--r-- | src/render_item.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/litehtml/render_item.h b/include/litehtml/render_item.h index 0a52b143..21c943b4 100644 --- a/include/litehtml/render_item.h +++ b/include/litehtml/render_item.h @@ -412,7 +412,7 @@ namespace litehtml std::tuple<int, int> element_static_offset(const std::shared_ptr<litehtml::render_item> &el); void add_positioned(const std::shared_ptr<litehtml::render_item> &el); void get_redraw_box(litehtml::position& pos, int x = 0, int y = 0); - void calc_document_size( litehtml::size& sz, int x = 0, int y = 0 ); + void calc_document_size( litehtml::size& sz, int x = 0, int y = 0 ) const; virtual void get_inline_boxes( position::vector& /*boxes*/ ) const {}; virtual void set_inline_boxes( position::vector& /*boxes*/ ) {}; virtual void add_inline_box( const position& /*box*/ ) {}; diff --git a/src/render_item.cpp b/src/render_item.cpp index 7292373a..0362685e 100644 --- a/src/render_item.cpp +++ b/src/render_item.cpp @@ -707,7 +707,7 @@ void litehtml::render_item::get_redraw_box(litehtml::position& pos, int x /*= 0* } } -void litehtml::render_item::calc_document_size( litehtml::size& sz, int x /*= 0*/, int y /*= 0*/ ) +void litehtml::render_item::calc_document_size( litehtml::size& sz, int x /*= 0*/, int y /*= 0*/ ) const { if(css().get_display() != display_inline && css().get_display() != display_table_row) { @@ -717,7 +717,7 @@ void litehtml::render_item::calc_document_size( litehtml::size& sz, int x /*= 0* sz.height = std::max(sz.height, y + bottom()); // All children of tables and blocks with style other than "overflow: visible" are inside element. - // We can skip calculating size of children + // We can skip calculating the size of children if (src_el()->css().get_overflow() == overflow_visible && src_el()->css().get_display() != display_table) { for (auto &el: m_children) @@ -730,7 +730,7 @@ void litehtml::render_item::calc_document_size( litehtml::size& sz, int x /*= 0* { position::vector boxes; get_inline_boxes(boxes); - for(auto& box : boxes) + for(const auto& box : boxes) { sz.width = std::max(sz.width, x + box.x + box.width); sz.height = std::max(sz.height, y + box.y + box.height); |