refresing control points when undoing topic move

This commit is contained in:
Pablo Luna 2011-01-20 12:05:42 -03:00
parent a6c066273b
commit 4b8d6a51f3
4 changed files with 13 additions and 1 deletions

View File

@ -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();

View File

@ -134,6 +134,9 @@ mindplot.CommandContext = new Class({
}
}.bind(this));
return result;
},
getSelectedRelationshipLines:function(){
return this._designer.getSelectedRelationshipLines();
}
});

View File

@ -73,7 +73,7 @@ mindplot.RelationshipLine.prototype.redraw = function()
this._refreshSelectedShape();
}
this._focusShape.moveToBack();
this._controlPointsController.redraw();
};
mindplot.RelationshipLine.prototype.addToWorkspace = function(workspace)

View File

@ -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)