mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 10:18:12 +08:00
Path Bool library code cleanup (#2000)
* Remove log statements * Add feature gates to functions in path.rs * Fix infinite parsing loop and add new test * License tweaks * Remove trailing zero in whole number floats * Flatten visual-tests directory * Code review * Clean up printlines * Add error handling to path parsing --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
3ddc052538
commit
8a1089938e
@@ -13,9 +13,10 @@ use crate::path_segment::PathSegment;
|
||||
pub type Path = Vec<PathSegment>;
|
||||
|
||||
fn reflect_control_point(point: DVec2, control_point: DVec2) -> DVec2 {
|
||||
point * 2.0 - control_point
|
||||
point * 2. - control_point
|
||||
}
|
||||
|
||||
#[cfg(feature = "parsing")]
|
||||
pub fn path_from_commands<I>(commands: I) -> impl Iterator<Item = PathSegment>
|
||||
where
|
||||
I: IntoIterator<Item = PathCommand>,
|
||||
@@ -93,6 +94,7 @@ where
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(feature = "parsing")]
|
||||
pub fn path_to_commands<'a, I>(segments: I, eps: f64) -> impl Iterator<Item = PathCommand> + 'a
|
||||
where
|
||||
I: IntoIterator<Item = &'a PathSegment> + 'a,
|
||||
|
||||
Reference in New Issue
Block a user