#[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. a 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 willed. The most common use case for this rule is as an optimisation when the paths are known to not be self-intersecting. There may also be cases where this rendering is desired. This can be implemented more efficiently than even-odd, 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
impl CheckedBitPattern for Fill
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
impl Contiguous for Fill
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 more