Skip to content

Commit

Permalink
Do not attach visualization on startup. (#5841)
Browse files Browse the repository at this point in the history
@hubertp has reported in #5620 that sometimes enabling visualization does not send "attachVisualization" message to the engine.

The actual cause was simply because it was already attached. Updating the default visualizations (when receiving information about type) updated the preprocessors, what caused in turn attaching visualization.

That was a bug, of course. This PR fixes it: now we don't update any visualization if it's hidden.
  • Loading branch information
farmaazon authored Mar 8, 2023
1 parent ad03f98 commit d3b247a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ syn = { version = "1.0", features = [
"extra-traits",
"printing",
"parsing",
"visit",
"visit-mut",
] }
quote = { version = "1.0.23" }
10 changes: 7 additions & 3 deletions app/gui/view/graph-editor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,12 +1619,16 @@ impl GraphEditorModelWithNetwork {

selected <- vis_is_selected.on_true();
deselected <- vis_is_selected.on_false();
output.visualization_preprocessor_changed <+
node_model.visualization.frp.preprocessor.map(move |preprocessor|
(node_id,preprocessor.clone()));
output.on_visualization_select <+ selected.constant(Switch::On(node_id));
output.on_visualization_select <+ deselected.constant(Switch::Off(node_id));

preprocessor_changed <-
node_model.visualization.frp.preprocessor.map(move |preprocessor| {
(node_id,preprocessor.clone())
});
output.visualization_preprocessor_changed <+ preprocessor_changed.gate(&node.visualization_visible);


metadata <- any(...);
metadata <+ node_model.visualization.frp.preprocessor.map(visualization::Metadata::new);

Expand Down

0 comments on commit d3b247a

Please sign in to comment.