graphics_style/shapes/
check_empty.rs

1use super::*;
2
3impl EdgeStyle {
4    #[inline(always)]
5    pub fn is_empty(&self) -> bool {
6        self.width <= 0.0 && self.texture.is_empty()
7    }
8}
9
10impl FillStyle {
11    #[inline(always)]
12    pub fn is_empty(&self) -> bool {
13        self.texture.is_empty()
14    }
15}
16
17impl Texture {
18    pub fn is_empty(&self) -> bool {
19        match self {
20            Texture::Color(c) => c.is_empty(),
21            Texture::Image(_) => {
22                todo!()
23            }
24            Texture::Gradient(_) => {
25                todo!()
26            }
27        }
28    }
29}
30
31impl Color {
32    /// Check if the color is opaque.
33    #[inline(always)]
34    pub fn is_empty(&self) -> bool {
35        self.view().3 == 0
36    }
37}