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

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