浏览代码

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 年之前
父节点
当前提交
c6fbeb5845
共有 1 个文件被更改,包括 1 次插入1 次删除
  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();