From 46c98dbf4320fa1047f29e649cdb34f5640def80 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 19 Apr 2023 23:39:14 +0300 Subject: [PATCH] LibWeb: Use device pixels to translate NestedBrowsingContextPaintable Fix translation of iframes when pixel size is not 1.0. --- .../LibWeb/Painting/NestedBrowsingContextPaintable.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp index b3e5056960..8f355b44ac 100644 --- a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp @@ -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()); - 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(hosted_layout_tree)->paint_all_phases(context);