Commit bdfe210e authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

parents 2cb35953 5da9a4aa
Subproject commit 8b33f729a570f3501769d16ad4c329c0e7f4e08d Subproject commit cfe7d5a248f0634d85dab3e51dc2d90d2d23ac5e
...@@ -355,12 +355,20 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -355,12 +355,20 @@ KityMinder.registerModule( "LayoutDefault", function () {
//以某个节点为seed对水平方向进行调整(包括调整子树) //以某个节点为seed对水平方向进行调整(包括调整子树)
var updateLayoutHorizon = function ( node ) { var updateLayoutHorizon = function ( node ) {
var nodeLayout = node.getData( "layout" ); var effectSet = []; //返回受影响(即需要进行下一步translate的节点)
var effectSet = [ node ]; //返回受影响(即需要进行下一步translate的节点) var _buffer = [ node ];
var parent = node.getParent(); while ( _buffer.length !== 0 ) {
var appendside = nodeLayout.appendside; var parent = _buffer[ 0 ].getParent();
var selfWidth = node.getRenderContainer().getWidth(); _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
if ( parent ) { if ( !parent ) {
effectSet.push( _buffer[ 0 ] );
_buffer.shift();
continue;
}
var nodeLayout = _buffer[ 0 ].getData( "layout" );
var appendside = nodeLayout.appendside;
var selfWidth = _buffer[ 0 ].getRenderContainer().getWidth();
var parentLayout = parent.getData( "layout" ); var parentLayout = parent.getData( "layout" );
var parentWidth = parent.getRenderContainer().getWidth(); var parentWidth = parent.getRenderContainer().getWidth();
if ( parentLayout.align === "center" ) parentWidth = parentWidth / 2; if ( parentLayout.align === "center" ) parentWidth = parentWidth / 2;
...@@ -376,6 +384,9 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -376,6 +384,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
default: default:
break; break;
} }
effectSet.push( _buffer[ 0 ] );
_buffer.shift();
} }
return effectSet; return effectSet;
}; };
......
...@@ -421,7 +421,6 @@ KityMinder.registerModule( "LayoutGreen", function () { ...@@ -421,7 +421,6 @@ KityMinder.registerModule( "LayoutGreen", function () {
initStyle: function () { initStyle: function () {
//绘制root并且调整到正确位置 //绘制root并且调整到正确位置
var _root = this.getRoot(); var _root = this.getRoot();
minder.getRenderContainer().clear();
minder.handelNodeInsert( _root ); minder.handelNodeInsert( _root );
var rc = new RootShape( _root ); var rc = new RootShape( _root );
translateNode( _root ); translateNode( _root );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment