Commit 6438da2d authored by Akikonata's avatar Akikonata

new style

parent fe1c871e
...@@ -141,7 +141,7 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -141,7 +141,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
var highlightshape = this._highlightshape = new kity.Rect(); var highlightshape = this._highlightshape = new kity.Rect();
bgRc.addShapes( [ highlightshape, underline ] ); bgRc.addShapes( [ highlightshape, underline ] );
var connect = this._connect = new kity.Path(); var connect = this._connect = new kity.Path();
minder.getRenderContainer().addShape( connect ).bringTop( minder.getRoot().getRenderContainer() ); minder.getRenderContainer().addShape( connect );
var Layout = { var Layout = {
stroke: new kity.Pen( "white", 1 ).setLineCap( "round" ).setLineJoin( "round" ), stroke: new kity.Pen( "white", 1 ).setLineCap( "round" ).setLineJoin( "round" ),
color: "white", color: "white",
...@@ -181,15 +181,23 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -181,15 +181,23 @@ KityMinder.registerModule( "LayoutBottom", function () {
this.updateShIcon(); this.updateShIcon();
}, },
updateConnect: function () { updateConnect: function () {
var connect = this._connect;
var node = this._node; var node = this._node;
var parentShape = node.getParent().getRenderContainer();
var parentBox = parentShape.getRenderBox();
var parentLayout = node.getParent().getData( "layout" );
var Layout = node.getData( "layout" ); var Layout = node.getData( "layout" );
var Shape = node.getRenderContainer(); if ( Layout.x && Layout.y ) {
var sX, sY = parentLayout.y; var connect = this._connect;
var nodeX, nodeY = Shape.getRenderBox().closurePoints[ 1 ].y; var parent = node.getParent();
var parentLayout = parent.getData( "layout" );
var sX = parentLayout.x + 10.5,
pY = parentLayout.y + parent.getRenderContainer().getHeight() + 10.5,
sY = Layout.y + 0.5;
connect.getDrawer()
.clear()
.moveTo( sX, pY )
.lineTo( sX, sY )
.lineTo( Layout.x + 0.5, sY )
.lineTo( Layout.x + 0.5, Layout.y + node.getRenderContainer().getHeight() );
connect.stroke( "white" );
}
}, },
updateShIcon: function () { updateShIcon: function () {
this._shicon.update(); this._shicon.update();
...@@ -284,7 +292,11 @@ KityMinder.registerModule( "LayoutBottom", function () { ...@@ -284,7 +292,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
} )(); } )();
Layout.branchwidth = ( nodewidth > nodeChildWidth ? nodewidth : nodeChildWidth ); Layout.branchwidth = ( nodewidth > nodeChildWidth ? nodewidth : nodeChildWidth );
}; };
countBranchWidth( node ); var parent = node;
while ( parent ) {
countBranchWidth( parent );
parent = parent.getParent();
}
while ( _buffer.length !== 0 ) { while ( _buffer.length !== 0 ) {
_buffer = _buffer.concat( _buffer[ 0 ].getChildren() ); _buffer = _buffer.concat( _buffer[ 0 ].getChildren() );
var bufferLayout = _buffer[ 0 ].getData( "layout" ); var bufferLayout = _buffer[ 0 ].getData( "layout" );
......
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