mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
Fix nondeterministic Vector point IDs from the 'As Vector' node
This commit is contained in:
@@ -58,7 +58,7 @@ impl graphene_hash::CacheHash for Vector {
|
|||||||
impl core_types::ops::FromAnchorPosition for Vector {
|
impl core_types::ops::FromAnchorPosition for Vector {
|
||||||
fn from_anchor_position(position: DVec2) -> Self {
|
fn from_anchor_position(position: DVec2) -> Self {
|
||||||
let mut point_domain = PointDomain::new();
|
let mut point_domain = PointDomain::new();
|
||||||
point_domain.push(PointId::generate(), position);
|
point_domain.push(PointId::ZERO, position);
|
||||||
|
|
||||||
Self { point_domain, ..Default::default() }
|
Self { point_domain, ..Default::default() }
|
||||||
}
|
}
|
||||||
@@ -646,7 +646,7 @@ mod tests {
|
|||||||
let vector = Vector::from_anchor_position(DVec2::new(3., 4.));
|
let vector = Vector::from_anchor_position(DVec2::new(3., 4.));
|
||||||
|
|
||||||
assert_eq!(vector.point_domain.positions(), [DVec2::new(3., 4.)]);
|
assert_eq!(vector.point_domain.positions(), [DVec2::new(3., 4.)]);
|
||||||
assert_eq!(vector.point_domain.ids().len(), 1);
|
assert_eq!(vector.point_domain.ids(), [PointId::ZERO], "expected the anchor position to be assigned the default PointId::ZERO",);
|
||||||
assert!(vector.segment_domain.ids().is_empty());
|
assert!(vector.segment_domain.ids().is_empty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user