From 2553234fa9275c86397fcfc539f5369df16611d2 Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Fri, 7 May 2021 13:19:55 +0100 Subject: [PATCH 1/5] Deselect visualization when the node gets removed --- src/rust/ide/view/graph-editor/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rust/ide/view/graph-editor/src/lib.rs b/src/rust/ide/view/graph-editor/src/lib.rs index 52cd599ea7..3738a56156 100644 --- a/src/rust/ide/view/graph-editor/src/lib.rs +++ b/src/rust/ide/view/graph-editor/src/lib.rs @@ -1405,6 +1405,7 @@ impl GraphEditorModel { let node_id = node_id.into(); self.nodes.remove(&node_id); self.nodes.selected.remove_item(&node_id); + self.frp.source.on_visualization_select.emit(Switch::Off(node_id)); } fn node_in_edges(&self, node_id:impl Into) -> Vec { From db7225ef496e321c29953f49ad4a7eb76cc1337d Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Fri, 7 May 2021 13:28:59 +0100 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 989fae8878..208e7544ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ #### Visual Environment - [Delete key will delete selected nodes][1538]. +- [It is possible to move around after deleting a selected visualization][1556]. #### EnsoGL (rendering engine) From 7a3d9927b3156216ef8d5427b243c51987d7a7cc Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Fri, 7 May 2021 13:40:43 +0100 Subject: [PATCH 3/5] Fix formatting of CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 208e7544ab..7b03e2243d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ #### Visual Environment - [Delete key will delete selected nodes][1538]. -- [It is possible to move around after deleting a selected visualization][1556]. +- [It is possible to move around after deleting a selected visualization][1556]. #### EnsoGL (rendering engine) From 5c42ee15f5d61c969c63d8f9fd17ebc2e6f58547 Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Fri, 7 May 2021 15:44:34 +0100 Subject: [PATCH 4/5] Deselect visualization before the node gets removed To make sure that the node id is still valid --- src/rust/ide/view/graph-editor/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/ide/view/graph-editor/src/lib.rs b/src/rust/ide/view/graph-editor/src/lib.rs index 8c961dc2a9..c36a14fe78 100644 --- a/src/rust/ide/view/graph-editor/src/lib.rs +++ b/src/rust/ide/view/graph-editor/src/lib.rs @@ -1403,9 +1403,9 @@ impl GraphEditorModel { /// implementation. fn remove_node(&self, node_id:impl Into) { let node_id = node_id.into(); + self.frp.source.on_visualization_select.emit(Switch::Off(node_id)); self.nodes.remove(&node_id); self.nodes.selected.remove_item(&node_id); - self.frp.source.on_visualization_select.emit(Switch::Off(node_id)); } fn node_in_edges(&self, node_id:impl Into) -> Vec { From a7ee9fedf7915b38fa25c72ef2dc4ccd11283cc0 Mon Sep 17 00:00:00 2001 From: Felix Rech Date: Mon, 10 May 2021 10:10:22 +0100 Subject: [PATCH 5/5] Follow review comments --- CHANGELOG.md | 5 ++++- src/rust/ide/view/graph-editor/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b03e2243d..eebfdb9817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,10 @@ #### Visual Environment - [Delete key will delete selected nodes][1538]. -- [It is possible to move around after deleting a selected visualization][1556]. +- [It is possible to move around after deleting a node with a selected + visualization][1556]. Deleting a node while its attached visualization was + selected made it impossible to pan or zoom around the stage afterwards. This + error is fixed now. #### EnsoGL (rendering engine) diff --git a/src/rust/ide/view/graph-editor/src/lib.rs b/src/rust/ide/view/graph-editor/src/lib.rs index c36a14fe78..44c8362f9b 100644 --- a/src/rust/ide/view/graph-editor/src/lib.rs +++ b/src/rust/ide/view/graph-editor/src/lib.rs @@ -1403,7 +1403,6 @@ impl GraphEditorModel { /// implementation. fn remove_node(&self, node_id:impl Into) { let node_id = node_id.into(); - self.frp.source.on_visualization_select.emit(Switch::Off(node_id)); self.nodes.remove(&node_id); self.nodes.selected.remove_item(&node_id); } @@ -2988,6 +2987,7 @@ fn new_graph_editor(app:&Application) -> GraphEditor { eval out.node_selected ((id) model.select_node(id)); eval out.node_deselected ((id) model.deselect_node(id)); eval out.node_removed ((id) model.remove_node(id)); + out.source.on_visualization_select <+ out.node_removed.map(|&id| Switch::Off(id)); eval inputs.set_node_expression (((id,expr)) model.set_node_expression(id,expr)); port_to_refresh <= inputs.set_node_expression.map(f!(((id,_))model.node_in_edges(id)));