mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-26 07:44:56 +01:00
- Bug Cannot call method 'getChildren' of null, line:1955 fixed.
This commit is contained in:
parent
ca37d3f384
commit
bcc5676b49
@ -335,39 +335,43 @@ mindplot.DesignerKeyboard = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_goToBrother:function (designer, node, direction) {
|
_goToBrother:function (designer, node, direction) {
|
||||||
var brothers = node.getParent().getChildren();
|
var parent = node.getParent();
|
||||||
var target = node;
|
if (parent) {
|
||||||
var y = node.getPosition().y;
|
var brothers = parent.getChildren();
|
||||||
var x = node.getPosition().x;
|
|
||||||
var dist = null;
|
var target = node;
|
||||||
for (var i = 0; i < brothers.length; i++) {
|
var y = node.getPosition().y;
|
||||||
var sameSide = (x * brothers[i].getPosition().x) >= 0;
|
var x = node.getPosition().x;
|
||||||
if (brothers[i] != node && sameSide) {
|
var dist = null;
|
||||||
var brother = brothers[i];
|
for (var i = 0; i < brothers.length; i++) {
|
||||||
var brotherY = brother.getPosition().y;
|
var sameSide = (x * brothers[i].getPosition().x) >= 0;
|
||||||
if (direction == "DOWN" && brotherY > y) {
|
if (brothers[i] != node && sameSide) {
|
||||||
var distancia = y - brotherY;
|
var brother = brothers[i];
|
||||||
if (distancia < 0) {
|
var brotherY = brother.getPosition().y;
|
||||||
distancia = distancia * (-1);
|
if (direction == "DOWN" && brotherY > y) {
|
||||||
|
var distancia = y - brotherY;
|
||||||
|
if (distancia < 0) {
|
||||||
|
distancia = distancia * (-1);
|
||||||
|
}
|
||||||
|
if (dist == null || dist > distancia) {
|
||||||
|
dist = distancia;
|
||||||
|
target = brothers[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dist == null || dist > distancia) {
|
else if (direction == "UP" && brotherY < y) {
|
||||||
dist = distancia;
|
var distance = y - brotherY;
|
||||||
target = brothers[i];
|
if (distance < 0) {
|
||||||
}
|
distance = distance * (-1);
|
||||||
}
|
}
|
||||||
else if (direction == "UP" && brotherY < y) {
|
if (dist == null || dist > distance) {
|
||||||
var distance = y - brotherY;
|
dist = distance;
|
||||||
if (distance < 0) {
|
target = brothers[i];
|
||||||
distance = distance * (-1);
|
}
|
||||||
}
|
|
||||||
if (dist == null || dist > distance) {
|
|
||||||
dist = distance;
|
|
||||||
target = brothers[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this._goToNode(designer, target);
|
||||||
}
|
}
|
||||||
this._goToNode(designer, target);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user