fixing icon positions on elipse shape, and curve lines with line shapes

This commit is contained in:
Pablo Luna 2011-02-09 16:06:28 +01:00
parent 9a41f3b288
commit df0a9a4496
2 changed files with 12 additions and 4 deletions

View File

@ -18,14 +18,22 @@
mindplot.IconGroup = function(topic) { mindplot.IconGroup = function(topic) {
var offset = topic.getOffset(); var offset = topic.getOffset();
var text = topic.getTextShape();
var yOffset = text.getPosition().y;
var shape = topic.getShapeType();
if(shape==mindplot.NodeModel.SHAPE_TYPE_ELIPSE){
yOffset +=2;
} else if( shape == mindplot.NodeModel.SHAPE_TYPE_LINE){
yOffset -=2;
}
this.options = { this.options = {
width:0, width:0,
height:0, height:0,
x:offset / 2, x:offset / 2,
y:offset / 2, y:yOffset,
icons:[], icons:[],
topic:topic, topic:topic,
nativeElem:new web2d.Group({width: 2, height:2,x: offset / 2, y:offset / 2, coordSizeWidth:1,coordSizeHeight:1}) nativeElem:new web2d.Group({width: 2, height:2,x: offset / 2, y:yOffset, coordSizeWidth:1,coordSizeHeight:1})
}; };
this.registerListeners(); this.registerListeners();
}; };

View File

@ -261,9 +261,9 @@ mindplot.MainTopic.prototype.workoutOutgoingConnectionPoint = function(targetPos
// In this case, connetion line is not used as shape figure. // In this case, connetion line is not used as shape figure.
result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true); result = mindplot.util.Shape.calculateRectConnectionPoint(pos, size, isAtRight, true);
result.y = pos.y + (size.height / 2); result.y = pos.y + (size.height / 2);
if(result.y>0){ /*if(result.y>0){
result.y+=1; result.y+=1;
} }*/
// Correction factor ... // Correction factor ...
if (!isAtRight) if (!isAtRight)