diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-09-21 15:36:32 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-21 16:53:46 +0200 |
commit | e07cf6f41b4ead77e7652e33a169e5784def5317 (patch) | |
tree | 666c78816c76a62385799c42a16e1fd73be821be /Userland/Libraries/LibWeb/Layout/CanvasBox.cpp | |
parent | 0b7eefd4e5f297151ff4250ecc77bb8f64c3f63e (diff) | |
download | serenity-e07cf6f41b4ead77e7652e33a169e5784def5317.zip |
LibWeb: Paint bitmaps with rounded_int_rect(), not enclosing_int_rect()
This fixes the issue where an `<img>` set to its native size would
sometimes still appear blurry, because it had a fractional position,
causing `enclosing_int_rect()` to expand by 1px.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/CanvasBox.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/CanvasBox.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/CanvasBox.cpp b/Userland/Libraries/LibWeb/Layout/CanvasBox.cpp index cdc9e2fad1..7a4731cf24 100644 --- a/Userland/Libraries/LibWeb/Layout/CanvasBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/CanvasBox.cpp @@ -39,7 +39,7 @@ void CanvasBox::paint(PaintContext& context, PaintPhase phase) return; if (dom_node().bitmap()) - context.painter().draw_scaled_bitmap(enclosing_int_rect(absolute_rect()), *dom_node().bitmap(), dom_node().bitmap()->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend); + context.painter().draw_scaled_bitmap(rounded_int_rect(absolute_rect()), *dom_node().bitmap(), dom_node().bitmap()->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend); } } |