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-75d572ba1dddmaster
parent
cfa2e640db
commit
281e70de9a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,11 @@ function RemoveElementCommand(elem, parent, text) {
|
|||
this.text = text || ("Delete " + elem.tagName);
|
||||
this.parent = parent;
|
||||
|
||||
this.apply = function() {
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue