Graphite icon indicating copy to clipboard operation
Graphite copied to clipboard

Switch LayerDataType struct values to nodes

Open Keavon opened this issue 2 years ago • 2 comments

Blocked on #771


#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
/// Represents different types of layers.
pub enum LayerDataType {
	/// A layer that wraps a [FolderLayer] struct.
	Folder(FolderLayer),
	/// A layer that wraps a [ShapeLayer] struct.
	Shape(ShapeLayer),
	/// A layer that wraps a [TextLayer] struct.
	Text(TextLayer),
	/// A layer that wraps an [ImageLayer] struct.
	Image(ImageLayer),
}

FolderLayer, ShapeLayer, TextLayer, and ImageLayer live in /graphene. Each of these four structs (saving FolderLayer for last) should be converted into nodes using the new node system in /node-graph.

Before porting over FolderLayer, that means each of these nodes just live as orphans, unconnected to one another. After successfully porting over those three, the next step is to connect them up into a tree by porting over FolderLayer which is a recursive data structure.

Questions for @TrueDoctor:

  • How does this approach relate to the separation between "document graph" and "proto graph"?
  • Can we continue to reference the other data structures defined in /graphene which are used by those three (four) structs once they are ported to nodes in /node-graph?
  • Where do these new vector-editing-specific nodes go in the node graph folder structure?
  • Any other things to be aware of?

Keavon avatar Aug 28 '22 01:08 Keavon

These would be document graph nodes so we are kinda blocked by my work on document nodes there

TrueDoctor avatar Aug 28 '22 09:08 TrueDoctor

@TrueDoctor Ok, thanks for clarifying that. Would you be able to meet with @0HyperCube and me soon to design that?

Keavon avatar Aug 28 '22 20:08 Keavon