Commit 744c5568 authored by Akikonata's avatar Akikonata

added spacing

parent 8d5fa8f0
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
//设置初始加载时展开的层数和子节点数目阈值 //设置初始加载时展开的层数和子节点数目阈值
, ,
expand: { expand: {
layer: 5, //最小为1 layer: 2, //最小为1
sub: 10 sub: 10
} }
}; };
......
KityMinder.registerModule( "IconModule", function () { KityMinder.registerModule( "IconModule", function () {
var minder = this;
var renderPriorityIcon = function ( node, val ) { var renderPriorityIcon = function ( node, val ) {
var colors = [ "", "#A92E24", "#29A6BD", "#1E8D54", "#eb6100", "#876DDA" ]; var colors = [ "", "#A92E24", "#29A6BD", "#1E8D54", "#eb6100", "#876DDA" ];
var _bg = new kity.Rect().fill( colors[ val ] ).setRadius( 3 ).setWidth( 20 ).setHeight( 20 ); var _bg = new kity.Rect().fill( colors[ val ] ).setRadius( 3 ).setWidth( 20 ).setHeight( 20 );
...@@ -45,8 +46,9 @@ KityMinder.registerModule( "IconModule", function () { ...@@ -45,8 +46,9 @@ KityMinder.registerModule( "IconModule", function () {
if ( val < 5 ) d.close(); if ( val < 5 ) d.close();
_percent.fill( "#29A6BD" ); _percent.fill( "#29A6BD" );
var pre = node.getData( "PriorityIcon" ); var pre = node.getData( "PriorityIcon" );
if ( !pre ) _rc.setTranslate( _contRc.getWidth() - _rc.getWidth() / 2, 0 ); var style = minder.getCurrentLayoutStyle()[ node.getType() ];
else _rc.setTranslate( _contRc.getWidth() + _rc.getWidth() / 2, 0 ); if ( !pre ) _rc.setTranslate( _rc.getWidth() / 2, 0 );
else _rc.setTranslate( _contRc.getWidth() + style.spaceLeft, 0 );
}; };
var setPriorityCommand = kity.createClass( "SetPriorityCommand", ( function () { var setPriorityCommand = kity.createClass( "SetPriorityCommand", ( function () {
return { return {
......
...@@ -84,7 +84,11 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -84,7 +84,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
padding: [ 15.5, 25.5, 15.5, 25.5 ], padding: [ 15.5, 25.5, 15.5, 25.5 ],
margin: [ 0, 0, 0, 0 ], margin: [ 0, 0, 0, 0 ],
radius: 30, radius: 30,
highlight: 'rgb(254, 219, 0)' highlight: 'rgb(254, 219, 0)',
spaceLeft: 3,
spaceRight: 0,
spaceTop: 3,
spaceBottom: 3
}, },
"main": { "main": {
stroke: new kity.Pen( "white", 2 ).setLineCap( "round" ).setLineJoin( "round" ), stroke: new kity.Pen( "white", 2 ).setLineCap( "round" ).setLineJoin( "round" ),
...@@ -94,7 +98,12 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -94,7 +98,12 @@ KityMinder.registerModule( "LayoutDefault", function () {
fontSize: 16, fontSize: 16,
margin: [ 0, 10, 30, 50 ], margin: [ 0, 10, 30, 50 ],
radius: 10, radius: 10,
highlight: 'rgb(254, 219, 0)' highlight: 'rgb(254, 219, 0)',
spaceLeft: 5,
spaceRight: 0,
spaceTop: 2,
spaceBottom: 2
}, },
"sub": { "sub": {
stroke: new kity.Pen( "white", 2 ).setLineCap( "round" ).setLineJoin( "round" ), stroke: new kity.Pen( "white", 2 ).setLineCap( "round" ).setLineJoin( "round" ),
...@@ -102,7 +111,11 @@ KityMinder.registerModule( "LayoutDefault", function () { ...@@ -102,7 +111,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
fontSize: 12, fontSize: 12,
margin: [ 0, 10, 20, 6 ], margin: [ 0, 10, 20, 6 ],
padding: [ 5, 10, 5.5, 10 ], padding: [ 5, 10, 5.5, 10 ],
highlight: 'rgb(254, 219, 0)' highlight: 'rgb(254, 219, 0)',
spaceLeft: 4,
spaceRight: 0,
spaceTop: 2,
spaceBottom: 2
} }
}; };
//更新背景 //更新背景
......
...@@ -10,7 +10,7 @@ KityMinder.registerModule( "NodeText", function () { ...@@ -10,7 +10,7 @@ KityMinder.registerModule( "NodeText", function () {
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.setTranslate( width, 0 ); textShape.setTranslate( width, 0 );
textShape.setVerticalAlign('middle'); textShape.setVerticalAlign( 'middle' );
} }
} }
} }
......
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