Skip to content

Commit

Permalink
LibWeb: Don't draw image alt text frames with "rough" rect
Browse files Browse the repository at this point in the history
This was an accident in 3645b67
  • Loading branch information
awesomekling committed Apr 14, 2024
1 parent c8cb9c7 commit 02ecfd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Binary file modified Tests/LibWeb/Ref/reference/images/alt-frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down

0 comments on commit 02ecfd7

Please sign in to comment.