diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-09 18:13:40 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-09 18:13:40 +0300 |
commit | 0e86b853be3b5f809ed1decbf636221c1144a386 (patch) | |
tree | 4ce84d9849646a559d5afece33fc6e64d39e4a50 /libs/litehtml/src/render_image.cpp | |
parent | 834cbb58d74215980165eab257538ba918a378cd (diff) |
litehtml update
Diffstat (limited to 'libs/litehtml/src/render_image.cpp')
-rw-r--r-- | libs/litehtml/src/render_image.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/litehtml/src/render_image.cpp b/libs/litehtml/src/render_image.cpp index 122344651b..23b059bd90 100644 --- a/libs/litehtml/src/render_image.cpp +++ b/libs/litehtml/src/render_image.cpp @@ -29,7 +29,7 @@ int litehtml::render_item_image::_render(int x, int y, const containing_block_co // check for max-width if(!src_el()->css().get_max_width().is_predefined()) { - int max_width = doc->to_pixels(src_el()->css().get_max_width(), src_el()->css().get_font_size(), parent_width); + int max_width = doc->to_pixels(css().get_max_width(), css().get_font_metrics(), parent_width); if(m_pos.width > max_width) { m_pos.width = max_width; @@ -90,7 +90,7 @@ int litehtml::render_item_image::_render(int x, int y, const containing_block_co // check for max-width if(!src_el()->css().get_max_width().is_predefined()) { - int max_width = doc->to_pixels(src_el()->css().get_max_width(), src_el()->css().get_font_size(), parent_width); + int max_width = doc->to_pixels(css().get_max_width(), css().get_font_metrics(), parent_width); if(m_pos.width > max_width) { m_pos.width = max_width; @@ -126,7 +126,7 @@ int litehtml::render_item_image::_render(int x, int y, const containing_block_co // check for max-height if(!src_el()->css().get_max_width().is_predefined()) { - int max_width = doc->to_pixels(src_el()->css().get_max_width(), src_el()->css().get_font_size(), parent_width); + int max_width = doc->to_pixels(css().get_max_width(), css().get_font_metrics(), parent_width); if(m_pos.width > max_width) { m_pos.width = max_width; @@ -143,6 +143,6 @@ int litehtml::render_item_image::_render(int x, int y, const containing_block_co int litehtml::render_item_image::calc_max_height(int image_height, int containing_block_height) { document::ptr doc = src_el()->get_document(); - return doc->to_pixels(src_el()->css().get_max_height(), src_el()->css().get_font_size(), + return doc->to_pixels(css().get_max_height(), css().get_font_metrics(), containing_block_height == 0 ? image_height : containing_block_height); } |