mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
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.
This commit is contained in:
parent
0b7eefd4e5
commit
e07cf6f41b
Notes:
sideshowbarker
2024-07-18 03:35:01 +09:00
Author: https://github.com/AtkinsSJ
Commit: e07cf6f41b
Pull-request: https://github.com/SerenityOS/serenity/pull/10166
3 changed files with 3 additions and 3 deletions
|
@ -96,7 +96,7 @@ void ImageBox::paint(PaintContext& context, PaintPhase phase)
|
|||
alt = image_element.src();
|
||||
context.painter().draw_text(enclosing_int_rect(absolute_rect()), alt, Gfx::TextAlignment::Center, computed_values().color(), Gfx::TextElision::Right);
|
||||
} else if (auto bitmap = m_image_loader.bitmap(m_image_loader.current_frame_index())) {
|
||||
context.painter().draw_scaled_bitmap(enclosing_int_rect(absolute_rect()), *bitmap, bitmap->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend);
|
||||
context.painter().draw_scaled_bitmap(rounded_int_rect(absolute_rect()), *bitmap, bitmap->rect(), 1.0f, Gfx::Painter::ScalingMode::BilinearBlend);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue