summaryrefslogtreecommitdiff
path: root/libs/litehtml/src/render_image.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-10-09 18:13:40 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-10-09 18:13:40 +0300
commit0e86b853be3b5f809ed1decbf636221c1144a386 (patch)
tree4ce84d9849646a559d5afece33fc6e64d39e4a50 /libs/litehtml/src/render_image.cpp
parent834cbb58d74215980165eab257538ba918a378cd (diff)
litehtml update
Diffstat (limited to 'libs/litehtml/src/render_image.cpp')
-rw-r--r--libs/litehtml/src/render_image.cpp8
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);
}