pub enum FillRule {
NonZero,
EvenOdd,
}Expand description
How closed contours determine the filled interior.
Recording retains both rules without silently substituting one for the default NonZero rule.
use motion_core::prelude::*;
use motion_core::{
DisplayList, RasterLimits, ResourcePool, ValidatedDisplayList, MAX_PATH_VERBS,
MAX_STROKE_VERBS, MAX_SVG_PATH_BYTES, sample_offsets,
};
let path = Path2D::from_rect(Rect::new(0.0, 0.0, 10.0, 20.0))?;
let fill = path.fill(Color::WHITE);
let native = DrawContext::default().record(&fill, ValidationLimits::default())?;
assert!(matches!(
native[0],
DrawCommand::Fill {
rule: FillRule::NonZero,
..
}
));
let even = DrawContext::default().record(
&fill.fill_rule(FillRule::EvenOdd),
ValidationLimits::default(),
)?;
assert!(matches!(
even[0],
DrawCommand::Fill {
rule: FillRule::EvenOdd,
..
}
));Variants§
Trait Implementations§
impl Copy for FillRule
impl Eq for FillRule
impl StructuralPartialEq for FillRule
Auto Trait Implementations§
impl Forget for FillRule
impl Freeze for FillRule
impl RefUnwindSafe for FillRule
impl Send for FillRule
impl Sync for FillRule
impl Unpin for FillRule
impl UnsafeUnpin for FillRule
impl UnwindSafe for FillRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more