#[repr(u8)]pub enum Fill {
NonZero = 0,
EvenOdd = 1,
}Expand description
Describes the rule that determines the interior portion of a shape.
This is only relevant for self-intersecting paths (e.g. an hourglass shape). For non-self-intersecting paths, both rules produce the same result.
Variants§
NonZero = 0
Non-zero fill rule.
All regions where the winding number of the path is not zero will be filled. This is generally more correct, but can be more expensive to implement in renderers. This matches the default behavior of the web canvas, and is the default value.
EvenOdd = 1
Even-odd fill rule.
All regions where the winding number of the path is odd will be filled. The most common use case for this rule is as an optimisation when the paths are known not to be self-intersecting. It is also useful for creating intentional holes in self-intersecting shapes (e.g. star or donut-like paths) or to match the SVG/Canvas even-odd fill rule. This can be implemented more efficiently than non-zero, as the winding number state can be stored in only one bit (and so the winding numbers for several pixels can be packed extremely efficiently).
Trait Implementations§
Source§impl CheckedBitPattern for Fill
Available on crate feature bytemuck only.
impl CheckedBitPattern for Fill
bytemuck only.Source§type Bits = u8
type Bits = u8
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(bits: &u8) -> bool
fn is_valid_bit_pattern(bits: &u8) -> bool
bits
as &Self.Source§impl Contiguous for Fill
Available on crate feature bytemuck only.
impl Contiguous for Fill
bytemuck only.Source§type Int = u8
type Int = u8
Source§fn from_integer(value: Self::Int) -> Option<Self>
fn from_integer(value: Self::Int) -> Option<Self>
value is within the range for valid instances of this type,
returns Some(converted_value), otherwise, returns None. Read moreSource§fn into_integer(self) -> Self::Int
fn into_integer(self) -> Self::Int
C into the underlying integral type. This
mostly exists otherwise generic code would need unsafe for the value as integer Read moreSource§impl<'de> Deserialize<'de> for Fill
impl<'de> Deserialize<'de> for Fill
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Fill
impl Eq for Fill
impl NoUninit for Fill
bytemuck only.