mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-23 04:18:11 +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
@@ -15,7 +15,7 @@ pub fn vector_angle(u: DVec2, v: DVec2) -> f64 {
|
||||
let sign = u.x * v.y - u.y * v.x;
|
||||
|
||||
if sign.abs() < EPS && (u + v).length_squared() < EPS * EPS {
|
||||
// TODO: u can be scaled
|
||||
// TODO: `u` can be scaled
|
||||
return PI;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,15 +72,15 @@ impl<T: Clone> QuadTree<T> {
|
||||
return;
|
||||
}
|
||||
|
||||
let midx = (self.bounding_box.left + self.bounding_box.right) / 2.0;
|
||||
let midy = (self.bounding_box.top + self.bounding_box.bottom) / 2.0;
|
||||
let mid_x = (self.bounding_box.left + self.bounding_box.right) / 2.;
|
||||
let mid_y = (self.bounding_box.top + self.bounding_box.bottom) / 2.;
|
||||
|
||||
self.subtrees = Some(Box::new([
|
||||
QuadTree::new(
|
||||
Aabb {
|
||||
top: self.bounding_box.top,
|
||||
right: midx,
|
||||
bottom: midy,
|
||||
right: mid_x,
|
||||
bottom: mid_y,
|
||||
left: self.bounding_box.left,
|
||||
},
|
||||
self.depth - 1,
|
||||
@@ -90,16 +90,16 @@ impl<T: Clone> QuadTree<T> {
|
||||
Aabb {
|
||||
top: self.bounding_box.top,
|
||||
right: self.bounding_box.right,
|
||||
bottom: midy,
|
||||
left: midx,
|
||||
bottom: mid_y,
|
||||
left: mid_x,
|
||||
},
|
||||
self.depth - 1,
|
||||
self.inner_node_capacity,
|
||||
),
|
||||
QuadTree::new(
|
||||
Aabb {
|
||||
top: midy,
|
||||
right: midx,
|
||||
top: mid_y,
|
||||
right: mid_x,
|
||||
bottom: self.bounding_box.bottom,
|
||||
left: self.bounding_box.left,
|
||||
},
|
||||
@@ -108,10 +108,10 @@ impl<T: Clone> QuadTree<T> {
|
||||
),
|
||||
QuadTree::new(
|
||||
Aabb {
|
||||
top: midy,
|
||||
top: mid_y,
|
||||
right: self.bounding_box.right,
|
||||
bottom: self.bounding_box.bottom,
|
||||
left: midx,
|
||||
left: mid_x,
|
||||
},
|
||||
self.depth - 1,
|
||||
self.inner_node_capacity,
|
||||
|
||||
Reference in New Issue
Block a user