mirror of
https://github.com/penpot/penpot.git
synced 2025-05-17 06:46:10 +02:00
🎉 Implement boolean operations (wasm)
This commit is contained in:
parent
1514faca55
commit
4e5f67676c
8 changed files with 126 additions and 16 deletions
25
render-wasm/src/shapes/bools.rs
Normal file
25
render-wasm/src/shapes/bools.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
pub enum BoolType {
|
||||
Union,
|
||||
Difference,
|
||||
Intersection,
|
||||
Exclusion,
|
||||
}
|
||||
|
||||
impl From<u8> for BoolType {
|
||||
fn from(value: u8) -> Self {
|
||||
match value {
|
||||
0 => Self::Union,
|
||||
1 => Self::Difference,
|
||||
2 => Self::Intersection,
|
||||
3 => Self::Exclusion,
|
||||
_ => Self::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for BoolType {
|
||||
fn default() -> Self {
|
||||
Self::Union
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue