fn disconnect_node(&mut self, id: usize, context: &mut ScreenContext) {

        if let Some(behavior) = context.data.get_mut_behavior(self.get_curr_behavior_id(context), self.graph_type) {
            let mut nothing_to_remove = false;
            while nothing_to_remove == false {
                nothing_to_remove = true;

                for (index, connection) in behavior.data.connections.iter().enumerate() {
                    if connection.0 == id || connection.2 == id {
                        //to_remove.push(index);
                        behavior.data.connections.remove(index);
                        nothing_to_remove = false;
                        break;
                    }
                }
            }
            behavior.save_data();
        }
        self.check_node_visibility(context);
    }
/// Disconnect the node from all connections
Disconnect the node from all connections
Disconnect the node from all connections
fn disconnect_node(&mut self, id: usize, context: &mut ScreenContext) {
        if let Some(behavior) = context.data.get_mut_behavior(self.get_curr_behavior_id(context), self.graph_type) {
            let mut nothing_to_remove = false;
            while nothing_to_remove == false {
                nothing_to_remove = true;
                for (index, connection) in behavior.data.connections.iter().enumerate() {
                    if connection.0 == id || connection.2 == id {
                        //to_remove.push(index);
                        behavior.data.connections.remove(index);
                        nothing_to_remove = false;
                        break;
                    }
                }
            }
            behavior.save_data();
        }
        self.check_node_visibility(context);
    }
fn disconnect_node ( & mut self , id : usize , context : & mut ScreenContext ) { if let Some ( behavior ) = context . data . get_mut_behavior ( self . get_curr_behavior_id ( context ) , self . graph_type ) { let mut nothing_to_remove = false ; while nothing_to_remove == false { nothing_to_remove = true ; for ( index , connection ) in behavior . data . connections . iter ( ) . enumerate ( ) { if connection . 0 == id || connection . 2 == id { //to_remove.push(index); behavior . data . connections . remove ( index ) ; nothing_to_remove = false ; break ; } } } behavior . save_data ( ) ; } self . check_node_visibility ( context ) ; }
Disconnect the node from all connections
Disconnect the node from all connections
&mut self
id
usize
context
&mut ScreenContext
&mut self
id
usize
context
&mut ScreenContext