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:
Dennis Kobert
2024-09-23 12:16:31 +02:00
committed by GitHub
co-authored by Keavon Chambers
parent 3ddc052538
commit 8a1089938e
175 changed files with 442 additions and 346 deletions
+1 -1
View File
@@ -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;
}
+10 -10
View File
@@ -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,