mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
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:
@@ -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
Reference in New Issue
Block a user