Commit c9d67aef authored by Akikonata's avatar Akikonata

changed style

parent e48a1ef0
......@@ -3,7 +3,6 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this.parent = null;
this.children = [];
this.data = {};
this._type = "main";
if ( Utils.isString( options ) ) {
this.setData( 'text', options );
} else {
......@@ -22,10 +21,10 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
return this.getData( 'point' );
},
setType: function ( type ) {
this._type = type;
this.setData( 'type', type );
},
getType: function ( type ) {
return this._type;
return this.getData( 'type' );
},
setText: function ( text ) {
this.setData( 'text', text );
......@@ -216,9 +215,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
return true;
},
getTextShape:function(){
getTextShape: function () {
var rc = this.getRenderContainer();
var text = rc.getElementsByTagName('text');
var text = rc.getElementsByTagName( 'text' );
}
} );
\ No newline at end of file
......@@ -109,9 +109,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
var connect = this._connect = new kity.Path();
minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() );
var Layout = {
stroke: new kity.Pen( "white", 1 ).setLineCap( "round" ),
stroke: new kity.Pen( "white", 1 ).setLineCap( "round" ).setLineJoin( "round" ),
color: "white",
padding: [ 5, 10, 5, 10 ],
padding: [ 5, 10, 5.5, 10 ],
fontSize: 12,
margin: [ 0, 10, 20, 5 ],
shape: this,
......@@ -156,13 +156,13 @@ KityMinder.registerModule( "LayoutDefault", function () {
var nodeX, nodeY = Shape.getRenderBox().closurePoints[ 1 ].y;
if ( Layout.appendside === "left" ) {
sX = parentBox.closurePoints[ 1 ].x - parentLayout.margin[ 1 ];
nodeX = Shape.getRenderBox().closurePoints[ 0 ].x - 1;
nodeX = Shape.getRenderBox().closurePoints[ 0 ].x;
connect.getDrawer()
.clear()
.moveTo( sX, sY )
.lineTo( sX, nodeY > sY ? ( nodeY - Layout.margin[ 3 ] ) : ( nodeY + Layout.margin[ 3 ] ) );
if ( nodeY > sY ) connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY );
else connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY, 0, 1 );
if ( nodeY > sY ) connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY, 0, 1 );
else connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY );
connect.stroke( Layout.stroke );
} else {
sX = parentBox.closurePoints[ 0 ].x + parentLayout.margin[ 1 ];
......@@ -171,8 +171,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
.clear()
.moveTo( sX, sY )
.lineTo( sX, nodeY > sY ? ( nodeY - Layout.margin[ 3 ] ) : ( nodeY + Layout.margin[ 3 ] ) );
if ( nodeY > sY ) connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY, 0, 1 );
else connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY );
if ( nodeY > sY ) connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY );
else connect.getDrawer().carcTo( Layout.margin[ 3 ], nodeX, nodeY, 0, 1 );
connect.stroke( Layout.stroke );
}
},
......@@ -373,6 +373,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
initStyle: function () {
//绘制root并且调整到正确位置
var _root = this.getRoot();
minder.getRenderContainer().clear();
minder.handelNodeInsert( _root );
var rc = new RootShape( _root );
translateNode( _root );
......
......@@ -68,6 +68,7 @@ KityMinder.registerModule( "LayoutModule", function () {
_root.preTraverse( function ( n ) {
n.clearLayout();
n.setPoint();
n.getRenderContainer().clear();
} );
km.setCurrentStyle( style );
km.initStyle();
......
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