1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibWeb: Don't attempt to paint text shadows for empty text fragments

This avoids the debug spam that happens then the shadow painting fails
to allocate a zero sized bitmap.
This commit is contained in:
MacDue 2022-10-18 22:06:29 +01:00 committed by Linus Groh
parent 89e308726e
commit c6fbeb5845

View file

@ -327,7 +327,7 @@ void paint_box_shadow(PaintContext& context, Gfx::IntRect const& content_rect, B
void paint_text_shadow(PaintContext& context, Layout::LineBoxFragment const& fragment, Vector<ShadowData> const& shadow_layers)
{
if (shadow_layers.is_empty())
if (shadow_layers.is_empty() || fragment.text().is_empty())
return;
auto& painter = context.painter();