From 77766e0a8fab64ebb74c3fc77a058274727d2316 Mon Sep 17 00:00:00 2001 From: Gonzalo Bellver Date: Thu, 16 Aug 2012 12:54:05 -0300 Subject: [PATCH] editor bug fix --- mindplot/src/main/javascript/layout/SymmetricSorter.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mindplot/src/main/javascript/layout/SymmetricSorter.js b/mindplot/src/main/javascript/layout/SymmetricSorter.js index f001f723..07400105 100644 --- a/mindplot/src/main/javascript/layout/SymmetricSorter.js +++ b/mindplot/src/main/javascript/layout/SymmetricSorter.js @@ -49,7 +49,7 @@ mindplot.layout.SymmetricSorter = new Class({ var sameParent = parent == graph.getParent(node); if (siblings.length == 0 && nodeDirection == positionDirection && sameParent) { - return [node.getOrder(), node.getPosition()]; + return [node.getOrder() + 1, node.getPosition()]; } } @@ -90,6 +90,12 @@ mindplot.layout.SymmetricSorter = new Class({ x:first.getPosition().x, y:first.getPosition().y - first.getSize().height - mindplot.layout.SymmetricSorter.INTERNODE_VERTICAL_PADDING * 2 }]; + return result; + } + + // if the node is moving down, substract 1 from the order + if (node != null && parent == graph.getParent(node) && result[1].y > node.getPosition().y) { + result[0] = result[0] - 1; } return result;