Commit 4fdb9851 authored by Akikonata's avatar Akikonata

clear

parent 389009a5
...@@ -353,7 +353,7 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -353,7 +353,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
} }
}, },
updateLayout: function ( node ) { updateLayout: function ( node ) {
node.getRenderContainer().clear(); node.getContRc().clear();
this._firePharse( new MinderEvent( "RenderNodeLeft", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node node: node
}, false ) ); }, false ) );
...@@ -390,7 +390,23 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -390,7 +390,23 @@ KityMinder.registerModule( "LayoutBottom", function () {
_root.getLayout().align = "center"; _root.getLayout().align = "center";
updateBg( _root ); updateBg( _root );
initLayout( _root ); initLayout( _root );
this.updateLayout( _root ); _root.getContRc().clear();
this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeCenter", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeRight", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeBottom", {
node: _root
}, false ) );
this._firePharse( new MinderEvent( "RenderNodeTop", {
node: _root
}, false ) );
updateShapeByCont( _root );
updateLayoutAll( _root ); updateLayoutAll( _root );
translateNode( _root ); translateNode( _root );
var _buffer = [ _root ]; var _buffer = [ _root ];
......
...@@ -440,7 +440,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -440,7 +440,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
} }
}, },
updateLayout: function ( node ) { updateLayout: function ( node ) {
node.getRenderContainer().clear(); node.getContRc().clear();
this._firePharse( new MinderEvent( "RenderNodeLeft", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: node node: node
}, false ) ); }, false ) );
...@@ -475,12 +475,7 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -475,12 +475,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root.getLayout().align = "center"; _root.getLayout().align = "center";
updateBg( _root ); updateBg( _root );
initLayout( _root ); initLayout( _root );
// this._fire( new MinderEvent( "beforeRenderNode", { _root.getContRc().clear();
// node: _root
// }, false ) );
// this._fire( new MinderEvent( "RenderNode", {
// node: _root
// }, false ) );
this._firePharse( new MinderEvent( "RenderNodeLeft", { this._firePharse( new MinderEvent( "RenderNodeLeft", {
node: _root node: _root
}, false ) ); }, false ) );
......
KityMinder.registerModule( "NodeText", function () { KityMinder.registerModule( "NodeText", function () {
var km = this; var km = this;
return { return {
events:{ events: {
'renderNodeCenter':function(e){ 'renderNodeCenter': function ( e ) {
var node = e.node; var node = e.node;
if(node.getType() == 'root') if ( node.getType() == 'root' )
debugger
var width = node.getContRc().getWidth(); var width = node.getContRc().getWidth();
var textShape = new kity.Text( node.getData( 'text' ) || '' ); var textShape = new kity.Text( node.getData( 'text' ) || '' );
textShape.setAttr( '_nodeTextShape', true ); textShape.setAttr( '_nodeTextShape', true );
node.getContRc().appendShape( textShape ); node.getContRc().appendShape( textShape );
var style = this.getCurrentLayoutStyle()[node.getType()]; var style = this.getCurrentLayoutStyle()[ node.getType() ];
textShape.fill(style.color).setSize(style.fontSize); textShape.fill( style.color ).setSize( style.fontSize );
textShape.setPosition(width,textShape.getHeight()*.75) textShape.setPosition( width, textShape.getHeight() * .75 )
} }
} }
} }
......
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