mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 23:38:06 +08:00
Add Vector Repeat Node (#1371)
* Implement skeleton for repeat node * Implemen RepeatNode
This commit is contained in:
@@ -1749,6 +1749,19 @@ fn static_nodes() -> Vec<DocumentNodeType> {
|
||||
properties: node_properties::stroke_properties,
|
||||
..Default::default()
|
||||
},
|
||||
DocumentNodeType {
|
||||
name: "Repeat",
|
||||
category: "Vector",
|
||||
identifier: NodeImplementation::proto("graphene_core::vector::RepeatNode<_, _>"),
|
||||
inputs: vec![
|
||||
DocumentInputType::value("Vector Data", TaggedValue::VectorData(graphene_core::vector::VectorData::empty()), true),
|
||||
DocumentInputType::value("Direction", TaggedValue::DVec2((100., 0.).into()), false),
|
||||
DocumentInputType::value("Count", TaggedValue::U32(10), false),
|
||||
],
|
||||
outputs: vec![DocumentOutputType::new("Vector", FrontendGraphDataType::Subpath)],
|
||||
properties: node_properties::repeat_properties,
|
||||
..Default::default()
|
||||
},
|
||||
DocumentNodeType {
|
||||
name: "Image Segmentation",
|
||||
category: "Image Adjustments",
|
||||
|
||||
@@ -1583,6 +1583,13 @@ pub fn stroke_properties(document_node: &DocumentNode, node_id: NodeId, _context
|
||||
]
|
||||
}
|
||||
|
||||
pub fn repeat_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let direction = vec2_widget(document_node, node_id, 1, "Direction", "X", "Y", " px", add_blank_assist);
|
||||
let count = number_widget(document_node, node_id, 2, "Count", NumberInput::default().min(1.), true);
|
||||
|
||||
vec![direction, LayoutGroup::Row { widgets: count }]
|
||||
}
|
||||
|
||||
/// Fill Node Widgets LayoutGroup
|
||||
pub fn fill_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
let fill_type_index = 1;
|
||||
|
||||
Reference in New Issue
Block a user