@ -205,21 +205,19 @@ class InteractionHandler {
selected = true ;
}
if ( selectedEdgesCount - previouslySelectedEdgeCount > 0 ) { // edge was selected
this . selectionHandler . _generateClickEvent ( 'selectEdge' , event , pointer ) ;
selected = true ;
}
else if ( selectedEdgesCount - previouslySelectedEdgeCount < 0 ) { // edge was deselected
this . selectionHandler . _generateClickEvent ( 'deselectEdge' , event , pointer , previousSelection ) ;
selected = true ;
if ( selectedEdgesCount - previouslySelectedEdgeCount < 0 || ( selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true ) ) { // edge was deselected
this . selectionHandler . _generateClickEvent ( 'deselectEdge' , event , pointer , previousSelection ) ;
selected = true ;
}
else if ( selectedEdgesCount === previouslySelectedEdgeCount && edgesChanges === true ) {
this . selectionHandler . _generateClickEvent ( 'deselectEdge' , event , pointer , previousSelection ) ;
// Check if the user clicked on an edge
let selectedNode = this . selectionHandler . _getSelectedNode ( ) ;
let selectedEdge = this . selectionHandler . _getSelectedEdge ( ) ;
if ( selectedNode === undefined && selectedEdge !== undefined ) {
this . selectionHandler . _generateClickEvent ( 'selectEdge' , event , pointer ) ;
selected = true ;
}
if ( selected === true ) { // select or unselect
this . selectionHandler . _generateClickEvent ( 'select' , event , pointer ) ;
}