mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Fix double line issue.
This commit is contained in:
parent
6ed1c1a0b0
commit
99146de711
@ -25,7 +25,6 @@ mindplot.ConnectionLine = new Class({
|
||||
this._targetTopic = targetNode;
|
||||
this._sourceTopic = sourceNode;
|
||||
|
||||
var strokeColor = mindplot.ConnectionLine.getStrokeColor();
|
||||
var line;
|
||||
var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode);
|
||||
if (targetNode.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||
@ -34,16 +33,18 @@ mindplot.ConnectionLine = new Class({
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setStroke(1, 'solid', strokeColor);
|
||||
} else {
|
||||
line = this._createLine(lineType, mindplot.ConnectionLine.SIMPLE_CURVED);
|
||||
if (line.getType() == "CurvedLine") {
|
||||
line.setSrcControlPoint(ctrlPoints[0]);
|
||||
line.setDestControlPoint(ctrlPoints[1]);
|
||||
}
|
||||
line.setStroke(1, 'solid', strokeColor);
|
||||
}
|
||||
line.setFill(mindplot.ConnectionLine.getStrokeColor());
|
||||
// Set line styles ...
|
||||
var strokeColor = mindplot.ConnectionLine.getStrokeColor();
|
||||
line.setStroke(1, 'solid', strokeColor, 1);
|
||||
line.setFill(strokeColor, 1);
|
||||
|
||||
this._line2d = line;
|
||||
},
|
||||
|
||||
@ -141,7 +142,6 @@ mindplot.ConnectionLine = new Class({
|
||||
},
|
||||
|
||||
setStroke : function(color, style, opacity) {
|
||||
var line2d = this._line2d;
|
||||
this._line2d.setStroke(null, null, color, opacity);
|
||||
},
|
||||
|
||||
|
@ -981,7 +981,8 @@ mindplot.Topic = new Class({
|
||||
size = {width:Math.ceil(size.width),height: Math.ceil(size.height)};
|
||||
|
||||
var oldSize = this.getSize();
|
||||
if (oldSize.width != size.width || oldSize.height != size.height || force) {
|
||||
var hasSizeChanged = oldSize.width != size.width || oldSize.height != size.height;
|
||||
if (hasSizeChanged || force) {
|
||||
mindplot.NodeGraph.prototype.setSize.call(this, size);
|
||||
|
||||
var outerShape = this.getOuterShape();
|
||||
@ -993,8 +994,10 @@ mindplot.Topic = new Class({
|
||||
// Update the figure position(ej: central topic must be centered) and children position.
|
||||
this._updatePositionOnChangeSize(oldSize, size);
|
||||
|
||||
if (hasSizeChanged) {
|
||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeResizeEvent, {node:this.getModel(),size:size});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_updatePositionOnChangeSize : function(oldSize, newSize) {
|
||||
@ -1094,13 +1097,6 @@ mindplot.Topic = new Class({
|
||||
var connector = targetTopic.getShrinkConnector();
|
||||
connector.setVisibility(true);
|
||||
|
||||
// Create a connection line ...
|
||||
var outgoingLine = new mindplot.ConnectionLine(this, targetTopic);
|
||||
if ($defined(isVisible))
|
||||
outgoingLine.setVisibility(isVisible);
|
||||
this._outgoingLine = outgoingLine;
|
||||
workspace.appendChild(outgoingLine);
|
||||
|
||||
// Redraw line ...
|
||||
outgoingLine.redraw();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user