Skip to content

Commit 4da732d

Browse files
authored
Fix artboard labels not reappearing once the node graph is closed to return to the viewport (#3061)
Closes #3045
1 parent 52174fa commit 4da732d

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageContext<'_>> for DocumentMes
582582
responses.add(NodeGraphMessage::UpdateHints);
583583
} else {
584584
responses.add(ToolMessage::ActivateTool { tool_type: *current_tool });
585+
responses.add(OverlaysMessage::Draw); // Redraw overlays when graph is closed
585586
}
586587
}
587588
DocumentMessage::GraphViewOverlayToggle => {

editor/src/messages/portfolio/document/node_graph/node_graph_message_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphMessageContext<'a>> for NodeG
16801680
responses.add(DocumentMessage::RenderRulers);
16811681
responses.add(DocumentMessage::RenderScrollbars);
16821682
responses.add(NodeGraphMessage::SendGraph);
1683+
responses.add(OverlaysMessage::Draw); // Redraw overlays to update artboard names
16831684
}
16841685
NodeGraphMessage::SetDisplayNameImpl { node_id, alias } => {
16851686
network_interface.set_display_name(&node_id, alias, selection_network_path);

editor/src/messages/tool/tool_message_handler.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ impl MessageHandler<ToolMessage, ToolMessageContext<'_>> for ToolMessageHandler
156156
// Subscribe new tool
157157
tool_data.tools.get(&tool_type).unwrap().activate(responses);
158158

159+
// Re-add the artboard overlay provider when tools are reactivated
160+
responses.add(OverlaysMessage::AddProvider(ARTBOARD_OVERLAY_PROVIDER));
161+
159162
// Send the SelectionChanged message to the active tool, this will ensure the selection is updated
160163
responses.add(BroadcastEvent::SelectionChanged);
161164

0 commit comments

Comments
 (0)