mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-05 18:08:12 +08:00
* Intial work * Improve miter and add round join * Get arcs to go opposite direction * Add cap and other refactors * Rename joint to join, fix some bugs * Fix single point issue * Clean up * Fix iframe sizes and update UI * Address comments and handle single point outline * Rename variables, fix branches in outline * Address comments
20 lines
361 B
Rust
20 lines
361 B
Rust
use bezier_rs::{Cap, Join};
|
|
|
|
pub fn parse_join(join: i32) -> Join {
|
|
match join {
|
|
0 => Join::Bevel,
|
|
1 => Join::Miter,
|
|
2 => Join::Round,
|
|
_ => panic!("Unexpected Join value: '{}'", join),
|
|
}
|
|
}
|
|
|
|
pub fn parse_cap(cap: i32) -> Cap {
|
|
match cap {
|
|
0 => Cap::Butt,
|
|
1 => Cap::Round,
|
|
2 => Cap::Square,
|
|
_ => panic!("Unexpected Cap value: '{}'", cap),
|
|
}
|
|
}
|