mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 23:17:44 +00:00
LibHTML: Trim image alt text to the right if necessary
This commit is contained in:
parent
6eef6f4f1d
commit
451730000c
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ void LayoutImage::render(RenderingContext& context)
|
||||||
auto alt = node().alt();
|
auto alt = node().alt();
|
||||||
if (alt.is_empty())
|
if (alt.is_empty())
|
||||||
alt = node().src();
|
alt = node().src();
|
||||||
context.painter().draw_text(rect(), alt, TextAlignment::Center, Color::Black);
|
context.painter().draw_text(rect(), alt, TextAlignment::Center, Color::Black, TextElision::Right);
|
||||||
} else {
|
} else {
|
||||||
context.painter().draw_scaled_bitmap(rect(), *node().bitmap(), node().bitmap()->rect());
|
context.painter().draw_scaled_bitmap(rect(), *node().bitmap(), node().bitmap()->rect());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue