Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Libraries/LibWeb/Painting/ReplacedElementCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Gfx::IntRect get_replaced_box_painting_area(Paintable const& paintable, DisplayL
if (paintable_rect.is_empty())
return {};

auto paintable_rect_device_pixels = context.rounded_device_rect(paintable_rect);

auto bitmap_aspect_ratio = content_size.height() / content_size.width();
auto image_aspect_ratio = paintable_rect.height() / paintable_rect.width();

Expand Down Expand Up @@ -90,11 +88,13 @@ Gfx::IntRect get_replaced_box_painting_area(Paintable const& paintable, DisplayL
offset_y = residual_vertical - object_position.offset_y.to_px(residual_vertical);
}

return Gfx::IntRect(
paintable_rect_device_pixels.x().value() + context.rounded_device_pixels(offset_x).value(),
paintable_rect_device_pixels.y().value() + context.rounded_device_pixels(offset_y).value(),
context.rounded_device_pixels(scaled_bitmap_width).value(),
context.rounded_device_pixels(scaled_bitmap_height).value());
auto destination_rect = CSSPixelRect {
paintable_rect.x() + offset_x,
paintable_rect.y() + offset_y,
scaled_bitmap_width,
scaled_bitmap_height,
};
return context.rounded_device_rect(destination_rect).to_type<int>();
}

}
Binary file modified Tests/LibWeb/Screenshot/expected/object-fit-position.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Tests/LibWeb/Screenshot/expected/video-object-fit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<meta name="fuzzy" content="maxDifference=0-7;totalPixels=0-8828" />
<meta name="fuzzy" content="maxDifference=0-7;totalPixels=0-8908" />
<style>
body {
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!doctype html>
<img style="position: fixed; left: 12.8px; top: 12.8px; width: 9.6px; height: 9.6px"
src='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill-rule="evenodd" d="M0 0h16v16h-16z M1 1h14v14h-14z"/></svg>'>
2 changes: 1 addition & 1 deletion Tests/LibWeb/Screenshot/input/video-object-fit.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<meta name="fuzzy" content="maxDifference=0-2;totalPixels=0-1239523">
<meta name="fuzzy" content="maxDifference=0-2;totalPixels=0-1240069">
<html class="reftest-wait">
<div>
<h2>480x240</h2>
Expand Down
Loading