mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:27:35 +00:00
LibWeb: Avoid truncation of aspect-ratio-computation in ImagePaintable
The value of the aspect ratio of the bitmap got truncated and this lead to funky rendering problems when using object-fit and object-position.
This commit is contained in:
parent
78c04cb8b2
commit
3a4d30dddc
1 changed files with 1 additions and 1 deletions
|
@ -68,7 +68,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
auto scaling_mode = to_gfx_scaling_mode(computed_values().image_rendering(), bitmap_rect, image_int_rect);
|
||||
auto& dom_element = verify_cast<DOM::Element>(*dom_node());
|
||||
auto object_fit = dom_element.computed_css_values()->object_fit();
|
||||
auto bitmap_aspect_ratio = bitmap_rect.height() / bitmap_rect.width();
|
||||
auto bitmap_aspect_ratio = (float)bitmap_rect.height() / bitmap_rect.width();
|
||||
auto image_aspect_ratio = (float)image_rect.height().value() / image_rect.width().value();
|
||||
|
||||
auto scale_x = 0.0f;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue