LibWeb: Don't draw image alt text frames with "rough" rect

This was an accident in 3645b676fb
This commit is contained in:
Andreas Kling 2024-04-14 13:38:16 +02:00
parent 217cb01708
commit cf315338ec
Notes: sideshowbarker 2024-07-16 22:16:50 +09:00
2 changed files with 1 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -66,7 +66,7 @@ void ImagePaintable::paint(PaintContext& context, PaintPhase phase) const
auto image_rect = context.rounded_device_rect(absolute_rect());
if (m_renders_as_alt_text) {
auto enclosing_rect = context.enclosing_device_rect(absolute_rect()).to_type<int>();
context.recording_painter().draw_rect(enclosing_rect, Gfx::Color::Black, 1);
context.recording_painter().draw_rect(enclosing_rect, Gfx::Color::Black);
context.recording_painter().draw_text(enclosing_rect, m_alt_text, Platform::FontPlugin::the().default_font(), Gfx::TextAlignment::Center, computed_values().color(), Gfx::TextElision::Right);
} else if (auto bitmap = m_image_provider.current_image_bitmap(image_rect.size().to_type<int>())) {
ScopedCornerRadiusClip corner_clip { context, image_rect, normalized_border_radii_data(ShrinkRadiiForBorders::Yes) };