From c6fbeb5845adc03deef29ab0b3a3139c80bcec70 Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 18 Oct 2022 22:06:29 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp index 137e03c304..15d43949d3 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp +++ b/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 const& shadow_layers) { - if (shadow_layers.is_empty()) + if (shadow_layers.is_empty() || fragment.text().is_empty()) return; auto& painter = context.painter();