pdf-comments-w14: net change of 3 commits

- pdf-comments-w14: written from its sheet
- pdf-comments-w14: repair 1
- pdf-comments-w14: review fixes (review-1)
This commit is contained in:
Dylan M. Taylor
2026-11-18 16:15:27 -05:00
parent 8a07d98b28
commit 85dda07ee0
2 changed files with 497 additions and 394 deletions
-7
View File
@@ -255,13 +255,6 @@ impl Geometry {
self.curve([mid, bcd, cd, d], depth + 1);
}
}
/// Rotate a proposed vertex onto the nearest 45-degree ray from the last vertex.
pub fn constrain(last: Point, point: Point) -> Point {
let v = sub(point, last);
let length = v[0].hypot(v[1]);
let angle = (v[1].atan2(v[0]) / std::f64::consts::FRAC_PI_4).round() * std::f64::consts::FRAC_PI_4;
[last[0] + length * angle.cos(), last[1] + length * angle.sin()]
}
/// Hold a proposed vertex level or plumb with the last vertex, whichever is nearer (a CAD
/// drawing's ortho mode): the vertex slides onto that axis rather than turning onto it.
pub fn ortho(last: Point, point: Point) -> Point {
File diff suppressed because it is too large Load Diff