mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-12-22 19:33:48 +01:00
fixing relationship lines
This commit is contained in:
parent
f73737ed0b
commit
5d911efa70
@ -269,7 +269,7 @@ core.Utils.calculateDefaultControlPoints = function(srcPos, tarPos){
|
||||
var x2 = tarPos.x + Math.sqrt(l*l/(1+(m*m)))*fix*-1;
|
||||
var y2= m*(x2-tarPos.x)+tarPos.y;
|
||||
|
||||
return [new core.Point(srcPos.x - x1,srcPos.y - y1),new core.Point(tarPos.x - x2,tarPos.y - y2)];
|
||||
return [new core.Point(-srcPos.x + x1,-srcPos.y + y1),new core.Point(-tarPos.x + x2,-tarPos.y + y2)];
|
||||
};
|
||||
|
||||
core.Utils.setVisibilityAnimated = function(elems, isVisible, doneFn){
|
||||
|
@ -280,6 +280,7 @@ mindplot.MindmapDesigner.prototype.addRelationShip2SelectedNode = function(event
|
||||
var selectedTopics = this.getSelectedNodes();
|
||||
if(selectedTopics.length >0 &&
|
||||
(!core.Utils.isDefined(this._creatingRelationship) || (core.Utils.isDefined(this._creatingRelationship) && !this._creatingRelationship))){
|
||||
this._workspace.enableWorkspaceEvents(false);
|
||||
var fromNodePosition = selectedTopics[0].getPosition();
|
||||
this._relationship = new web2d.CurvedLine();
|
||||
this._relationship.setStyle(web2d.CurvedLine.SIMPLE_LINE);
|
||||
@ -318,6 +319,7 @@ mindplot.MindmapDesigner.prototype._relationshipMouseClick = function (event, fr
|
||||
this._workspace.getScreenManager().removeEventListener('mousemove',this._relationshipMouseMoveFunction);
|
||||
this._workspace.getScreenManager().removeEventListener('click',this._relationshipMouseClickFunction);
|
||||
this._creatingRelationship=false;
|
||||
this._workspace.enableWorkspaceEvents(true);
|
||||
event.preventDefault();
|
||||
event.stop();
|
||||
return false;
|
||||
|
@ -67,7 +67,7 @@ mindplot.RelationshipLine.prototype.redraw = function()
|
||||
var sPos,tPos;
|
||||
this._line2d.setStroke(2);
|
||||
var ctrlPoints = this._line2d.getControlPoints();
|
||||
if(!core.Utils.isDefined(ctrlPoints[0].x) || !core.Utils.isDefined(ctrlPoints[1].x)){
|
||||
if(!this._line2d.isDestControlPointCustom() && !this._line2d.isSrcControlPointCustom()){
|
||||
var defaultPoints = core.Utils.calculateDefaultControlPoints(sourcePosition, targetPosition);
|
||||
ctrlPoints[0].x=defaultPoints[0].x;
|
||||
ctrlPoints[0].y=defaultPoints[0].y;
|
||||
|
Loading…
Reference in New Issue
Block a user