mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-19 02:48:12 +08:00
Move session state out of the network interface caches and replace the selection hijacks with explicit parameters (#4379)
* Move drag offsets out of the stack dependents cache into dedicated drag session state * Replace the move_layer_to_stack selection hijack with a seeded stack dependents load * Move text measurement into a neutral utility module out of the overlays layer * Deduplicate the document bounds queries and name the artboard clip input index * Replace the remove_references_from_network selection hijack with an explicit shift set * Extract shared import and export wire disconnection used by the expose handlers * Extract the shared epilogue of the import and export removal operations * Move the post node lookup into the network interface to fix the layering inversion * Clear drag offsets when the stack dependents cache unloads so programmatic shifts cannot replay them * Use the thread-local text context for text measurement instead of a process-global mutex * Resolve the post node lookup within the network being edited instead of the document root
This commit is contained in:
@@ -324,11 +324,19 @@ impl EditorTestUtils {
|
||||
}
|
||||
|
||||
pub async fn create_node_by_name(&mut self, node_type: DefinitionIdentifier) -> NodeId {
|
||||
self.create_node(node_type, None).await
|
||||
}
|
||||
|
||||
pub async fn create_node_by_name_at(&mut self, node_type: DefinitionIdentifier, x: i32, y: i32) -> NodeId {
|
||||
self.create_node(node_type, Some((x, y))).await
|
||||
}
|
||||
|
||||
async fn create_node(&mut self, node_type: DefinitionIdentifier, xy: Option<(i32, i32)>) -> NodeId {
|
||||
let node_id = NodeId::new();
|
||||
self.handle_message(NodeGraphMessage::CreateNodeFromContextMenu {
|
||||
node_id: Some(node_id),
|
||||
node_type,
|
||||
xy: None,
|
||||
xy,
|
||||
add_transaction: true,
|
||||
})
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user