Fixed bug where matrix transform was left on right-clicked elements, and one where imported SVGs had the same ID as their use elems

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1677 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-08-23 13:58:51 +00:00
parent 8bedfda8c4
commit 576f76e671
1 changed files with 10 additions and 8 deletions

View File

@ -4276,13 +4276,15 @@ var getMouseTarget = this.getMouseTarget = function(evt) {
pathActions.clear();
}
// else if it's a path, go into pathedit mode in mouseup
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var i = 0; i < selectedElements.length; ++i) {
if(selectedElements[i] == null) continue;
var slist = getTransformList(selectedElements[i]);
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
if(!right_click) {
// insert a dummy transform so if the element(s) are moved it will have
// a transform to use for its translate
for (var i = 0; i < selectedElements.length; ++i) {
if(selectedElements[i] == null) continue;
var slist = getTransformList(selectedElements[i]);
slist.insertItemBefore(svgroot.createSVGTransform(), 0);
}
}
}
else if(!right_click){
@ -8237,10 +8239,10 @@ this.importSvgString = function(xmlString) {
symbol.id = getNextId();
var use_el = svgdoc.createElementNS(svgns, "use");
use_el.id = getNextId();
setHref(use_el, "#" + symbol.id);
findDefs().appendChild(symbol);
current_layer.appendChild(use_el);
use_el.id = getNextId();
clearSelection();
use_el.setAttribute("transform", ts);