mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 22:18: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:
@@ -5,7 +5,7 @@ use crate::TValue;
|
||||
|
||||
use glam::DVec2;
|
||||
|
||||
impl Subpath {
|
||||
impl<ManipulatorGroupId: crate::Identifier> Subpath<ManipulatorGroupId> {
|
||||
/// Calculate the point on the subpath based on the parametric `t`-value provided.
|
||||
/// Expects `t` to be within the inclusive range `[0, 1]`.
|
||||
/// <iframe frameBorder="0" width="100%" height="400px" src="https://graphite.rs/bezier-rs-demos#subpath/evaluate/solo" title="Evaluate Demo"></iframe>
|
||||
@@ -144,11 +144,13 @@ mod tests {
|
||||
anchor: start,
|
||||
in_handle: None,
|
||||
out_handle: Some(handle),
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: end,
|
||||
in_handle: None,
|
||||
out_handle: Some(handle),
|
||||
id: EmptyId,
|
||||
},
|
||||
],
|
||||
false,
|
||||
@@ -186,16 +188,19 @@ mod tests {
|
||||
anchor: start,
|
||||
in_handle: Some(handle3),
|
||||
out_handle: None,
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: middle,
|
||||
in_handle: None,
|
||||
out_handle: Some(handle1),
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: end,
|
||||
in_handle: None,
|
||||
out_handle: Some(handle2),
|
||||
id: EmptyId,
|
||||
},
|
||||
],
|
||||
false,
|
||||
@@ -290,16 +295,19 @@ mod tests {
|
||||
anchor: cubic_start,
|
||||
in_handle: None,
|
||||
out_handle: Some(cubic_handle_1),
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: cubic_end,
|
||||
in_handle: Some(cubic_handle_2),
|
||||
out_handle: None,
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: quadratic_end,
|
||||
in_handle: Some(quadratic_1_handle),
|
||||
out_handle: Some(quadratic_2_handle),
|
||||
id: EmptyId,
|
||||
},
|
||||
],
|
||||
true,
|
||||
@@ -366,16 +374,19 @@ mod tests {
|
||||
anchor: cubic_start,
|
||||
in_handle: None,
|
||||
out_handle: Some(cubic_handle_1),
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: cubic_end,
|
||||
in_handle: Some(cubic_handle_2),
|
||||
out_handle: None,
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: quadratic_end,
|
||||
in_handle: Some(quadratic_1_handle),
|
||||
out_handle: Some(quadratic_2_handle),
|
||||
id: EmptyId,
|
||||
},
|
||||
],
|
||||
true,
|
||||
@@ -431,16 +442,19 @@ mod tests {
|
||||
anchor: cubic_start,
|
||||
in_handle: None,
|
||||
out_handle: Some(cubic_handle_1),
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: cubic_end,
|
||||
in_handle: Some(cubic_handle_2),
|
||||
out_handle: None,
|
||||
id: EmptyId,
|
||||
},
|
||||
ManipulatorGroup {
|
||||
anchor: quadratic_end,
|
||||
in_handle: Some(quadratic_1_handle),
|
||||
out_handle: Some(quadratic_2_handle),
|
||||
id: EmptyId,
|
||||
},
|
||||
],
|
||||
true,
|
||||
|
||||
Reference in New Issue
Block a user