Commit 6e39cff5 authored by campaign's avatar campaign

修改光标定位

parent 78cb63bf
...@@ -226,8 +226,12 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -226,8 +226,12 @@ Minder.Receiver = kity.createClass( 'Receiver', {
} }
return this; return this;
}, },
getBaseOffset: function ( node ) { getBaseOffset: function ( ) {
var rb = this.textShape.getRenderBox( this.km.getRenderContainer() ); var rb = this.textShape.getRenderBox( this.km.getRenderContainer() );
// if(!this.pr) {
// this.km.getRenderContainer().addShape(this.pr = new kity.Rect().stroke('green'));
// }
// this.pr.setSize(rb.width, rb.height).setPosition(rb.x, rb.y);
return rb; return rb;
}, },
setBaseOffset: function () { setBaseOffset: function () {
...@@ -235,7 +239,7 @@ Minder.Receiver = kity.createClass( 'Receiver', { ...@@ -235,7 +239,7 @@ Minder.Receiver = kity.createClass( 'Receiver', {
return this; return this;
}, },
setContainerStyle: function () { setContainerStyle: function () {
var textShapeBox = this.getBaseOffset( 'top' ); var textShapeBox = this.getBaseOffset();
this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 5 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;'; this.container.style.cssText = ";left:" + textShapeBox.x + 'px;top:' + ( textShapeBox.y - 5 ) + 'px;width:' + textShapeBox.width + 'px;height:' + textShapeBox.height + 'px;';
return this; return this;
......
...@@ -9,7 +9,8 @@ KityMinder.registerModule( "NodeText", function () { ...@@ -9,7 +9,8 @@ KityMinder.registerModule( "NodeText", function () {
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() * .25 ) textShape.setTranslate( width, 0 );
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