Skip to content

Commit

Permalink
fix #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Spydr06 committed Sep 22, 2023
1 parent 2e3e46e commit a9f474b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/application/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Action {
app.imp().rerender_editor();
}
Self::DeleteSelection(plot_provider, blocks, connections, incoming) => {
println!("delete connections: {connections:?} incoming: {incoming:?}");
//println!("delete connections: {connections:?} incoming: {incoming:?}");
*incoming = plot_provider.with_mut(|plot| {
for connection in &*connections {
plot.remove_connection(connection.id());
Expand Down
13 changes: 10 additions & 3 deletions src/ui/circuit_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,16 @@ impl CircuitViewTemplate {
block.set_highlighted(true);
let start_position = block.position();

if let Selection::None = plot.selection() {
plot.unhighlight();
plot.set_selection(Selection::Single(Selectable::Block(id), start_position));
match plot.selection() {
Selection::None => {
plot.unhighlight();
plot.set_selection(Selection::Single(Selectable::Block(id), start_position));
}
Selection::Many(sel) if sel.is_empty() => {
plot.unhighlight();
plot.set_selection(Selection::Single(Selectable::Block(id), start_position));
}
_ => {}
}

//drop(plot);
Expand Down

0 comments on commit a9f474b

Please sign in to comment.