diff --git a/dist/vis.js b/dist/vis.js index 4771003e..da418db2 100644 --- a/dist/vis.js +++ b/dist/vis.js @@ -10643,18 +10643,22 @@ Edge.prototype.draw = function(ctx) { * @return {boolean} True if location is located on the edge */ Edge.prototype.isOverlappingWith = function(obj) { - var distMax = 10; + if (this.connected == true) { + var distMax = 10; + var xFrom = this.from.x; + var yFrom = this.from.y; + var xTo = this.to.x; + var yTo = this.to.y; + var xObj = obj.left; + var yObj = obj.top; - var xFrom = this.from.x; - var yFrom = this.from.y; - var xTo = this.to.x; - var yTo = this.to.y; - var xObj = obj.left; - var yObj = obj.top; + var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj); - var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj); - - return (dist < distMax); + return (dist < distMax); + } + else { + return false + } }; @@ -17318,6 +17322,7 @@ Graph.prototype._removeNodes = function(ids) { delete nodes[id]; } this._updateNodeIndexList(); + this._updateCalculationNodes(); this._reconnectEdges(); this._updateSelection(); this._updateValueRange(nodes); diff --git a/src/graph/Edge.js b/src/graph/Edge.js index f748455b..12fd5672 100644 --- a/src/graph/Edge.js +++ b/src/graph/Edge.js @@ -216,18 +216,22 @@ Edge.prototype.draw = function(ctx) { * @return {boolean} True if location is located on the edge */ Edge.prototype.isOverlappingWith = function(obj) { - var distMax = 10; - - var xFrom = this.from.x; - var yFrom = this.from.y; - var xTo = this.to.x; - var yTo = this.to.y; - var xObj = obj.left; - var yObj = obj.top; - - var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj); - - return (dist < distMax); + if (this.connected == true) { + var distMax = 10; + var xFrom = this.from.x; + var yFrom = this.from.y; + var xTo = this.to.x; + var yTo = this.to.y; + var xObj = obj.left; + var yObj = obj.top; + + var dist = this._getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj); + + return (dist < distMax); + } + else { + return false + } }; diff --git a/src/graph/Graph.js b/src/graph/Graph.js index ea3b0f48..50f70cbd 100644 --- a/src/graph/Graph.js +++ b/src/graph/Graph.js @@ -1322,6 +1322,7 @@ Graph.prototype._removeNodes = function(ids) { delete nodes[id]; } this._updateNodeIndexList(); + this._updateCalculationNodes(); this._reconnectEdges(); this._updateSelection(); this._updateValueRange(nodes);