rive_rs/shapes/
fill_rule.rs

1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::core::TryFromU64;
6
7#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub enum FillRule {
9    NonZero,
10    EvenOdd,
11}
12
13impl Default for FillRule {
14    fn default() -> Self {
15        Self::NonZero
16    }
17}
18
19impl TryFromU64 for FillRule {
20    fn try_from(value: u64) -> Option<Self> {
21        match value {
22            0 => Some(Self::NonZero),
23            1 => Some(Self::EvenOdd),
24            _ => None,
25        }
26    }
27}