mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 01:28:11 +08:00
Bézier-rs: Add ids to manipulator groups (#1054)
* Add ids to manipulator groups * Fix tests * Rename trait from ManipulatorGroupId to Identifier * Rename EmptyManipulatorGroupId to EmptyId
This commit is contained in:
@@ -6,9 +6,18 @@ use glam::DVec2;
|
||||
use std::fmt::Write;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub(crate) struct EmptyId;
|
||||
|
||||
impl bezier_rs::Identifier for EmptyId {
|
||||
fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper of the `Subpath` struct to be used in JS.
|
||||
#[wasm_bindgen]
|
||||
pub struct WasmSubpath(Subpath);
|
||||
pub struct WasmSubpath(Subpath<EmptyId>);
|
||||
|
||||
const SCALE_UNIT_VECTOR_FACTOR: f64 = 50.;
|
||||
|
||||
@@ -31,6 +40,7 @@ impl WasmSubpath {
|
||||
anchor: point_triple[0].unwrap(),
|
||||
in_handle: point_triple[1],
|
||||
out_handle: point_triple[2],
|
||||
id: EmptyId,
|
||||
})
|
||||
.collect();
|
||||
WasmSubpath(Subpath::new(manipulator_groups, closed))
|
||||
|
||||
Reference in New Issue
Block a user