From 4b8d6a51f33145dddab8b0cb02127bd1a052454b Mon Sep 17 00:00:00 2001 From: Pablo Luna Date: Thu, 20 Jan 2011 12:05:42 -0300 Subject: [PATCH] refresing control points when undoing topic move --- mindplot/src/main/javascript/ControlPoint.js | 5 +++++ mindplot/src/main/javascript/DesignerActionRunner.js | 3 +++ mindplot/src/main/javascript/RelationshipLine.js | 2 +- mindplot/src/main/javascript/commands/DragTopicCommand.js | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mindplot/src/main/javascript/ControlPoint.js b/mindplot/src/main/javascript/ControlPoint.js index 980ff90a..716b5658 100644 --- a/mindplot/src/main/javascript/ControlPoint.js +++ b/mindplot/src/main/javascript/ControlPoint.js @@ -49,6 +49,11 @@ mindplot.ControlPoint.prototype.setLine= function(line) { this._endPoint[1] = this._line.getLine().getTo().clone(); }; +mindplot.ControlPoint.prototype.redraw = function(){ + if(this._line) + this._createControlPoint(); +}; + mindplot.ControlPoint.prototype._createControlPoint = function() { this._controls= this._line.getLine().getControlPoints(); var pos = this._line.getLine().getFrom(); diff --git a/mindplot/src/main/javascript/DesignerActionRunner.js b/mindplot/src/main/javascript/DesignerActionRunner.js index 10dc6f8e..379d063d 100644 --- a/mindplot/src/main/javascript/DesignerActionRunner.js +++ b/mindplot/src/main/javascript/DesignerActionRunner.js @@ -134,6 +134,9 @@ mindplot.CommandContext = new Class({ } }.bind(this)); return result; + }, + getSelectedRelationshipLines:function(){ + return this._designer.getSelectedRelationshipLines(); } }); diff --git a/mindplot/src/main/javascript/RelationshipLine.js b/mindplot/src/main/javascript/RelationshipLine.js index 2b28cbff..be910437 100644 --- a/mindplot/src/main/javascript/RelationshipLine.js +++ b/mindplot/src/main/javascript/RelationshipLine.js @@ -73,7 +73,7 @@ mindplot.RelationshipLine.prototype.redraw = function() this._refreshSelectedShape(); } this._focusShape.moveToBack(); - + this._controlPointsController.redraw(); }; mindplot.RelationshipLine.prototype.addToWorkspace = function(workspace) diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js index 7006c7d1..8b066ee8 100644 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ b/mindplot/src/main/javascript/commands/DragTopicCommand.js @@ -86,6 +86,10 @@ mindplot.commands.DragTopicCommand = mindplot.Command.extend( undoExecute: function(commandContext) { this.execute(commandContext); + var selectedRelationships = commandContext.getSelectedRelationshipLines(); + selectedRelationships.forEach(function(relationshipLine,index){ + relationshipLine.redraw(); + }); }, setPosition: function(point)