mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-06 17:08:12 +08:00
Bezier-rs: Add curvature and rotate functions to subpath (#1081)
* Add rotate and curvature * Fix comments * Fix case where curve is linear * Address comments * Fixed breakages caused by UI updates * Scootch rotation point to center in frame * Code review * Visualize t value point when segment is linear --------- Co-authored-by: Rob Nadal <robnadal44@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Rob Nadal
Keavon Chambers
parent
3f8adbafba
commit
d0ac86b713
@@ -283,7 +283,7 @@ impl Bezier {
|
||||
let line_directional_vector = other.end - other.start;
|
||||
let angle = line_directional_vector.angle_between(DVec2::new(1., 0.));
|
||||
let rotation_matrix = DMat2::from_angle(angle);
|
||||
let rotated_bezier = self.apply_transformation(&|point| rotation_matrix.mul_vec2(point));
|
||||
let rotated_bezier = self.apply_transformation(|point| rotation_matrix.mul_vec2(point));
|
||||
let rotated_line = [rotation_matrix.mul_vec2(other.start), rotation_matrix.mul_vec2(other.end)];
|
||||
|
||||
// Translate the bezier such that the line becomes aligned on top of the x-axis
|
||||
|
||||
Reference in New Issue
Block a user