Fixed issue 559: Polyline doesn't rotate correctly in safari and chrome. Also made undo/redo work better for markers

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1589 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-06-08 16:48:41 +00:00
parent cfa2e640db
commit 281e70de9a
2 changed files with 15 additions and 1 deletions

View File

@ -301,10 +301,16 @@ svgEditor.addExtension("Markers", function(S) {
var m = elem.getAttribute(nam);
if (m) pline.setAttribute(nam,elem.getAttribute(nam));
});
var batchCmd = new S.BatchCommand();
batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode));
batchCmd.addSubCommand(new S.InsertElementCommand(pline));
$(elem).after(pline).remove();
svgCanvas.clearSelection();
pline.id = id;
svgCanvas.addToSelection([pline]);
S.addCommandToHistory(batchCmd);
return pline;
}

View File

@ -316,6 +316,10 @@ function RemoveElementCommand(elem, parent, text) {
this.parent = parent;
this.apply = function() {
if (svgTransformLists[this.elem.id]) {
delete svgTransformLists[this.elem.id];
}
this.parent = this.elem.parentNode;
this.elem = this.parent.removeChild(this.elem);
if (this.parent == svgcontent) {
@ -324,6 +328,10 @@ function RemoveElementCommand(elem, parent, text) {
};
this.unapply = function() {
if (svgTransformLists[this.elem.id]) {
delete svgTransformLists[this.elem.id];
}
this.elem = this.parent.insertBefore(this.elem, this.elem.nextSibling);
if (this.parent == svgcontent) {
identifyLayers();