mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-28 14:38:11 +08:00
Implement function that projects to a Bezier curve (#688)
* UI section for the projection function * added bezier project impl * Fix project function and add test for it * Search method * Re-use comptued distances * Update comments * rebase project changes * clean up tests and library code * use built-in functions and destructure syntax * Remove redundant project implementation * Fix typo, add lut size as parameter and add constant * address comments Co-authored-by: Thomas Cheng <contact.chengthomas@gmail.com>
This commit is contained in:
co-authored by
Thomas Cheng
parent
3476d5a203
commit
4775a23c17
@@ -98,4 +98,8 @@ impl WasmBezier {
|
||||
pub fn trim(&self, t1: f64, t2: f64) -> WasmBezier {
|
||||
WasmBezier(self.0.trim(t1, t2))
|
||||
}
|
||||
|
||||
pub fn project(&self, x: f64, y: f64) -> JsValue {
|
||||
vec_to_point(&self.0.project(DVec2::new(x, y), 20, 1e-4, 3, 10))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user