Skip to content

Commit

Permalink
Compare float with epsilon to determine transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOptik authored and vE5li committed Feb 29, 2024
1 parent 6781130 commit e522548
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/interface/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e522548

Please sign in to comment.