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-75d572ba1dddmaster
parent
0a3c2c56a1
commit
bb38edf3db
|
@ -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!");
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue