Bläddra i källkod

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.
MacDue 2 år sedan
förälder
incheckning
c6fbeb5845
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp

+ 1 - 1
Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp

@@ -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();