|
@ -272,7 +272,7 @@ class View { |
|
|
*/ |
|
|
*/ |
|
|
_lockedRedraw() { |
|
|
_lockedRedraw() { |
|
|
var nodePosition = {x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y}; |
|
|
var nodePosition = {x: this.body.nodes[this.lockedOnNodeId].x, y: this.body.nodes[this.lockedOnNodeId].y}; |
|
|
var viewCenter = this.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight}); |
|
|
|
|
|
|
|
|
var viewCenter = this.canvas.DOMtoCanvas({x: 0.5 * this.frame.canvas.clientWidth, y: 0.5 * this.frame.canvas.clientHeight}); |
|
|
var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
|
|
|
var distanceFromCenter = { // offset from view, distance view has to change by these x and y to center the node
|
|
|
x: viewCenter.x - nodePosition.x, |
|
|
x: viewCenter.x - nodePosition.x, |
|
|
y: viewCenter.y - nodePosition.y |
|
|
y: viewCenter.y - nodePosition.y |
|
|