1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

LibWeb: Use device pixels to translate NestedBrowsingContextPaintable

Fix translation of iframes when pixel size is not 1.0.
This commit is contained in:
Aliaksandr Kalenik 2023-04-19 23:39:14 +03:00 committed by Andreas Kling
parent 37c9dbe248
commit 46c98dbf43

View file

@ -51,7 +51,9 @@ void NestedBrowsingContextPaintable::paint(PaintContext& context, PaintPhase pha
auto old_viewport_rect = context.device_viewport_rect();
context.painter().add_clip_rect(clip_rect.to_type<int>());
context.painter().translate(absolute_rect.x().value(), absolute_rect.y().value());
auto absolute_device_rect = context.enclosing_device_rect(absolute_rect);
context.painter().translate(absolute_device_rect.x().value(), absolute_device_rect.y().value());
context.set_device_viewport_rect({ {}, context.enclosing_device_size(layout_box().dom_node().nested_browsing_context()->size()) });
const_cast<Layout::Viewport*>(hosted_layout_tree)->paint_all_phases(context);