From e522548b6b25e09aff7c8cb51a9d77e65e581e6b Mon Sep 17 00:00:00 2001 From: TheOptik Date: Thu, 29 Feb 2024 23:41:24 +0100 Subject: [PATCH] Compare float with epsilon to determine transparency --- src/interface/windows/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/interface/windows/mod.rs b/src/interface/windows/mod.rs index ff72b39a..39d6d799 100644 --- a/src/interface/windows/mod.rs +++ b/src/interface/windows/mod.rs @@ -51,7 +51,8 @@ impl Window { } pub fn has_transparency(&self, theme: &InterfaceTheme) -> bool { - self.get_background_color(theme).alpha_as_u8() != 255 + const TRANSPARENCY_THRESHOLD: f32 = 0.999; + self.get_background_color(theme).alpha < TRANSPARENCY_THRESHOLD } pub fn is_closable(&self) -> bool {