mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-20 03:18:06 +08:00
Add artboard displayed names in the viewport (#1795)
* possible location of the change is decided. * fix for issue #1774 * possible location of the change is decided. * fix for issue #1774 * fix for #1706 * fix for #1706, code reformatted * fix for #1706, Label input removed from Properties * fix for #1706 * deleted the comment
This commit is contained in:
@@ -709,6 +709,7 @@ impl MessageHandler<GraphOperationMessage, GraphOperationMessageData<'_>> for Gr
|
||||
responses.add(DocumentMessage::RenderRulers);
|
||||
responses.add(DocumentMessage::RenderScrollbars);
|
||||
responses.add(NodeGraphMessage::SendGraph);
|
||||
responses.add(NodeGraphMessage::RunDocumentGraph);
|
||||
}
|
||||
}
|
||||
GraphOperationMessage::SetNodeInput { node_id, input_index, input } => {
|
||||
|
||||
@@ -314,6 +314,7 @@ impl<'a> ModifyInputsContext<'a> {
|
||||
|
||||
ModifyInputsContext::insert_node_as_primary_export(node_graph, document_network, new_id, artboard_node)
|
||||
}
|
||||
|
||||
pub fn insert_vector_data(&mut self, subpaths: Vec<Subpath<ManipulatorGroupId>>, layer: NodeId) {
|
||||
let shape = {
|
||||
let node_type: &crate::messages::portfolio::document::node_graph::document_node_types::DocumentNodeDefinition = resolve_document_node_type("Shape").expect("Shape node does not exist");
|
||||
|
||||
@@ -266,13 +266,14 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
name: "To Artboard".to_string(),
|
||||
manual_composition: Some(concrete!(Footprint)),
|
||||
inputs: vec![
|
||||
NodeInput::network(concrete!(graphene_core::GraphicGroup), 1),
|
||||
NodeInput::network(concrete!(TaggedValue), 1),
|
||||
NodeInput::value(TaggedValue::String(String::from("Artboard")), false),
|
||||
NodeInput::network(concrete!(TaggedValue), 2),
|
||||
NodeInput::network(concrete!(TaggedValue), 3),
|
||||
NodeInput::network(concrete!(TaggedValue), 4),
|
||||
NodeInput::network(concrete!(TaggedValue), 5),
|
||||
],
|
||||
implementation: DocumentNodeImplementation::proto("graphene_core::ConstructArtboardNode<_, _, _, _, _>"),
|
||||
implementation: DocumentNodeImplementation::proto("graphene_core::ConstructArtboardNode<_, _, _, _, _, _>"),
|
||||
metadata: DocumentNodeMetadata { position: glam::IVec2::new(-10, -3) }, // To Artboard
|
||||
..Default::default()
|
||||
},
|
||||
@@ -309,7 +310,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
|
||||
}),
|
||||
inputs: vec![
|
||||
DocumentInputType::value("Artboards", TaggedValue::ArtboardGroup(ArtboardGroup::EMPTY), true),
|
||||
DocumentInputType::value("Over", TaggedValue::GraphicGroup(GraphicGroup::EMPTY), true),
|
||||
DocumentInputType::value("Contents", TaggedValue::GraphicGroup(GraphicGroup::EMPTY), true),
|
||||
DocumentInputType::value("Location", TaggedValue::IVec2(glam::IVec2::ZERO), false),
|
||||
DocumentInputType::value("Dimensions", TaggedValue::IVec2(glam::IVec2::new(1920, 1080)), false),
|
||||
DocumentInputType::value("Background", TaggedValue::Color(Color::WHITE), false),
|
||||
|
||||
@@ -1408,7 +1408,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||
self.update_click_target(node_id, document_network, self.network.clone());
|
||||
responses.add(DocumentMessage::RenderRulers);
|
||||
responses.add(DocumentMessage::RenderScrollbars);
|
||||
self.send_graph(document_network, document_metadata, collapsed, graph_view_overlay_open, responses);
|
||||
responses.add(NodeGraphMessage::SendGraph);
|
||||
}
|
||||
}
|
||||
NodeGraphMessage::StartPreviewingWithoutRestore { node_id } => {
|
||||
|
||||
@@ -2448,8 +2448,10 @@ pub fn artboard_properties(document_node: &DocumentNode, node_id: NodeId, _conte
|
||||
let dimensions = vec2_widget(document_node, node_id, 3, "Dimensions", "W", "H", " px", None, add_blank_assist);
|
||||
let background = color_widget(document_node, node_id, 4, "Background", ColorButton::default().allow_none(false), true);
|
||||
let clip = bool_widget(document_node, node_id, 5, "Clip", true);
|
||||
let clip = LayoutGroup::Row { widgets: clip };
|
||||
vec![location, dimensions, background, clip]
|
||||
|
||||
let clip_row = LayoutGroup::Row { widgets: clip };
|
||||
|
||||
vec![location, dimensions, background, clip_row]
|
||||
}
|
||||
|
||||
pub fn color_fill_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||
|
||||
@@ -306,6 +306,7 @@ impl Fsm for ArtboardToolFsmState {
|
||||
id,
|
||||
artboard: graphene_core::Artboard {
|
||||
graphic_group: graphene_core::GraphicGroup::EMPTY,
|
||||
label: String::from("Artboard"),
|
||||
location: start.round().as_ivec2(),
|
||||
dimensions: IVec2::splat(1),
|
||||
background: graphene_core::Color::WHITE,
|
||||
|
||||
Reference in New Issue
Block a user