LibHTML: Trim image alt text to the right if necessary

This commit is contained in:
Conrad Pankoff 2019-10-06 23:27:01 +11:00 committed by Andreas Kling
parent 6eef6f4f1d
commit 451730000c
Notes: sideshowbarker 2024-07-19 11:46:59 +09:00

View file

@ -40,7 +40,7 @@ void LayoutImage::render(RenderingContext& context)
auto alt = node().alt();
if (alt.is_empty())
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 {
context.painter().draw_scaled_bitmap(rect(), *node().bitmap(), node().bitmap()->rect());
}