From 93cf061f4c2d45669f5da3a478183c67b9df6e8b Mon Sep 17 00:00:00 2001 From: Gonzalo Bellver Date: Mon, 2 Jan 2012 17:38:02 -0300 Subject: [PATCH] Merge fix --- mindplot/src/main/javascript/nlayout/GridSorter.js | 2 +- .../src/main/javascript/nlayout/OriginalLayout.js | 8 +++++--- .../src/main/javascript/nlayout/SymetricSorter.js | 12 ++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/mindplot/src/main/javascript/nlayout/GridSorter.js b/mindplot/src/main/javascript/nlayout/GridSorter.js index 8152988a..83e9b276 100644 --- a/mindplot/src/main/javascript/nlayout/GridSorter.js +++ b/mindplot/src/main/javascript/nlayout/GridSorter.js @@ -1,5 +1,5 @@ mindplot.nlayout.GridSorter = new Class({ - Extends: mindplot.nlayout.SymetricSorder, + Extends: mindplot.nlayout.SymetricSorter, computeOffsets: function(treeSet, node) { $assert(treeSet, "treeSet can no be null."); diff --git a/mindplot/src/main/javascript/nlayout/OriginalLayout.js b/mindplot/src/main/javascript/nlayout/OriginalLayout.js index 66322056..d32b5714 100644 --- a/mindplot/src/main/javascript/nlayout/OriginalLayout.js +++ b/mindplot/src/main/javascript/nlayout/OriginalLayout.js @@ -83,7 +83,10 @@ mindplot.nlayout.OriginalLayout = new Class({ var verticalOffset = (node.getSize().height / 2); - var newPos = {x:parentX + offset.x,y:parentY + offset.y + verticalOffset}; + //TODO(gb): Not sure why verticalOffset is added again, since it is considered in the layout + var newPos = {x:parentX + offset.x,y:parentY + offset.y}; +// var newPos = {x:parentX + offset.x,y:parentY + offset.y + verticalOffset}; + this._treeSet.updateBranchPosition(child, newPos); }.bind(this)); @@ -98,9 +101,8 @@ mindplot.nlayout.OriginalLayout = new Class({ }); -mindplot.nlayout.OriginalLayout.SYMETRIC_SORTER = new mindplot.nlayout.SymetricSorder(); +mindplot.nlayout.OriginalLayout.SYMETRIC_SORTER = new mindplot.nlayout.SymetricSorter(); mindplot.nlayout.OriginalLayout.GRID_SORTER = new mindplot.nlayout.GridSorter(); -//mindplot.nlayout.OriginalLayout.GRID_SORTER = new mindplot.nlayout.SymetricSorder(); diff --git a/mindplot/src/main/javascript/nlayout/SymetricSorter.js b/mindplot/src/main/javascript/nlayout/SymetricSorter.js index d3e17d04..9a053532 100644 --- a/mindplot/src/main/javascript/nlayout/SymetricSorter.js +++ b/mindplot/src/main/javascript/nlayout/SymetricSorter.js @@ -1,4 +1,4 @@ -mindplot.nlayout.SymetricSorder = new Class({ +mindplot.nlayout.SymetricSorter = new Class({ Extends: mindplot.nlayout.ChildrenSorterStrategy, initialize:function() { @@ -11,7 +11,7 @@ mindplot.nlayout.SymetricSorder = new Class({ }, _computeChildrenHeight : function(treeSet, node, heightCache) { - var height = node.getSize().height + (mindplot.nlayout.SymetricSorder.INTERNODE_VERTICAL_PADDING * 2); // 2* Top and down padding; + var height = node.getSize().height + (mindplot.nlayout.SymetricSorter.INTERNODE_VERTICAL_PADDING * 2); // 2* Top and down padding; var result; var children = treeSet.getChildren(node); @@ -57,7 +57,7 @@ mindplot.nlayout.SymetricSorder = new Class({ // Ok, no overlap. Suggest a new order. if (result) { var last = children.getLast(); - result = [last.getOrder() + 1,{x:cpos.x,y:cpos.y - (mindplot.nlayout.SymetricSorder.INTERNODE_VERTICAL_PADDING * 4)}]; + result = [last.getOrder() + 1,{x:cpos.x,y:cpos.y - (mindplot.nlayout.SymetricSorter.INTERNODE_VERTICAL_PADDING * 4)}]; } return result; @@ -133,7 +133,7 @@ mindplot.nlayout.SymetricSorder = new Class({ ysum = ysum - heights[i].height; var yOffset = ysum + heights[i].height/2; - var xOffset = node.getSize().width + mindplot.nlayout.SymetricSorder.INTERNODE_HORIZONTAL_PADDING; + var xOffset = node.getSize().width + mindplot.nlayout.SymetricSorter.INTERNODE_HORIZONTAL_PADDING; $assert(!isNaN(xOffset), "xOffset can not be null"); $assert(!isNaN(yOffset), "yOffset can not be null"); @@ -149,7 +149,7 @@ mindplot.nlayout.SymetricSorder = new Class({ } }); -mindplot.nlayout.SymetricSorder.INTERNODE_VERTICAL_PADDING = 5; -mindplot.nlayout.SymetricSorder.INTERNODE_HORIZONTAL_PADDING = 5; +mindplot.nlayout.SymetricSorter.INTERNODE_VERTICAL_PADDING = 5; +mindplot.nlayout.SymetricSorter.INTERNODE_HORIZONTAL_PADDING = 5;