From 01ce2044917825e6656825cf87573e788af3b339 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 22 Dec 2023 09:29:56 +0100 Subject: [PATCH] Avoid painting a background quad if it is fully transparent --- crates/gpui2/src/style.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui2/src/style.rs b/crates/gpui2/src/style.rs index de54da79b3d0eb1e7489962143dbbc7d0dc0809f..c281818c0f0bad1107d49a8b1895762c910e8af7 100644 --- a/crates/gpui2/src/style.rs +++ b/crates/gpui2/src/style.rs @@ -384,7 +384,7 @@ impl Style { }); let background_color = self.background.as_ref().and_then(Fill::color); - if background_color.is_some() { + if background_color.map_or(false, |color| !color.is_transparent()) { cx.with_z_index(1, |cx| { cx.paint_quad(quad( bounds,