Add Layer and Artboard node definitions and underlying data structures (#1204)

* Add basic node defenitions

* Code review

* change widget code

* Artboard node changes

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-05-09 21:57:22 +01:00
committed by Keavon Chambers
parent 7e1b452757
commit 4e0c673a35
12 changed files with 295 additions and 36 deletions

View File

@@ -17,6 +17,15 @@ pub struct VectorData {
pub mirror_angle: Vec<ManipulatorGroupId>,
}
impl core::hash::Hash for VectorData {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.subpaths.hash(state);
self.transform.to_cols_array().iter().for_each(|x| x.to_bits().hash(state));
self.style.hash(state);
self.mirror_angle.hash(state);
}
}
impl VectorData {
/// An empty subpath with no data, an identity transform, and a black fill.
pub const fn empty() -> Self {