mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-07 05:08:12 +08:00
* Implement miter-limit approximation * Refactor to use Join enum and address other comments * Rustdocs improvements * Tweaks --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
20 lines
398 B
Rust
20 lines
398 B
Rust
use bezier_rs::{Cap, Join};
|
|
|
|
pub fn parse_join(join: i32, miter_limit: f64) -> Join {
|
|
match join {
|
|
0 => Join::Bevel,
|
|
1 => Join::Miter(Some(miter_limit)),
|
|
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),
|
|
}
|
|
}
|