mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-04 22:08:13 +08:00
Bezier-rs: Updated Bezier function signatures to accept TValue (#967)
* Create helper for converting d to t values * Add euclidean option for tangent and normal * Modified bezier functions signatures to accept ComputeType * Stylistic changes per review * Added ComputeType documentation * Renamed ComputeType to TValue * Fixed comments * Fixed failing unit tests * Code review * Fix comments in code review * Renamed compute_type_to_parametric to t_value_to_parametric --------- Co-authored-by: Linda Zheng <thelindazheng@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Linda Zheng
Keavon Chambers
parent
f0ad4c91d3
commit
a64c856ec4
@@ -1,5 +1,5 @@
|
||||
use super::*;
|
||||
use crate::{ComputeType, ProjectionOptions};
|
||||
use crate::{ProjectionOptions, TValue};
|
||||
use glam::DVec2;
|
||||
|
||||
/// Functionality relating to looking up properties of the `Subpath` or points along the `Subpath`.
|
||||
@@ -22,7 +22,7 @@ impl Subpath {
|
||||
.iter()
|
||||
.map(|bezier| {
|
||||
let project_t = bezier.project(point, options);
|
||||
(bezier.evaluate(ComputeType::Parametric(project_t)).distance(point), project_t)
|
||||
(bezier.evaluate(TValue::Parametric(project_t)).distance(point), project_t)
|
||||
})
|
||||
.enumerate()
|
||||
.min_by(|(_, (distance1, _)), (_, (distance2, _))| distance1.total_cmp(distance2))
|
||||
|
||||
Reference in New Issue
Block a user