Fix new layer naming code by antimatter15. Fix rotation of groups problem.

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@777 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-10-08 02:16:36 +00:00
parent 0a3c2c56a1
commit bb38edf3db
2 changed files with 10 additions and 3 deletions

View File

@ -1126,7 +1126,14 @@ function svg_edit_setup() {
$('#layer_new').click(function() {
var curNames = new Array(svgCanvas.getNumLayers());
for (var i = 0; i < curNames.length; ++i) { curNames[i] = svgCanvas.getLayer(i); }
var newName = prompt("Please enter a unique layer name","Layer "+(curNames.length+1));
var j = (curNames.length+1);
var uniqName = "Layer " + j;
while (jQuery.inArray(uniqName, curNames) != -1) {
j++;
uniqName = "Layer " + j;
}
var newName = prompt("Please enter a unique layer name",uniqName);
if (!newName) return;
if (jQuery.inArray(newName, curNames) != -1) {
alert("There is already a layer named that!");

View File

@ -3921,8 +3921,8 @@ function BatchCommand(text) {
while (i--) {
var elem = elems[i];
if (elem == null) continue;
// only allow the transform attribute to change on <g> elements, slightly hacky
if (elem.tagName == "g" && attr == "transform") continue;
// only allow the transform/opacity attribute to change on <g> elements, slightly hacky
if (elem.tagName == "g" && (attr != "transform" && attr != "opacity")) continue;
var oldval = attr == "#text" ? elem.textContent : elem.getAttribute(attr);
if (oldval == null) oldval = "";
if (oldval != newValue) {