diff --git a/src/style.rs b/src/style.rs index eb6e014..cd92f49 100644 --- a/src/style.rs +++ b/src/style.rs @@ -7,7 +7,7 @@ use kurbo::Stroke; /// /// This is only relevant for self-intersecting paths (e.g. a hourglass shape). /// For non-self-intersecting paths, both rules produce the same result. -#[derive(Copy, Clone, PartialEq, Eq, Debug)] +#[derive(Copy, Clone, Default, PartialEq, Eq, Debug)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[repr(u8)] pub enum Fill { @@ -16,6 +16,7 @@ pub enum Fill { /// 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. + #[default] NonZero = 0, /// Even-odd fill rule. /// @@ -42,12 +43,6 @@ pub enum Style { Stroke(Stroke), } -impl Default for Fill { - fn default() -> Self { - Self::NonZero - } -} - impl From for Style { fn from(fill: Fill) -> Self { Self::Fill(fill)