diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 2e985990..f50e7323 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -2163,9 +2163,18 @@ function svg_edit_setup() { $('#lang_select').val(lang); if(strings) { // $.extend will only replace the given strings + var oldLayerName = $('#layerlist tr.layersel td.layername').text(); + var rename_layer = (oldLayerName == uiStrings.layer + ' 1'); + $.extend(uiStrings,strings); svgCanvas.setUiStrings(strings); Actions.setTitles(); + + if(rename_layer) { + svgCanvas.renameCurrentLayer(uiStrings.layer + ' 1'); + populateLayers(); + } + } }; diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 9a99a1bd..0d9262fe 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -5101,6 +5101,7 @@ function BatchCommand(text) { var spacer = .85; var bb; var calcZoom = function(bb) { + if(!bb) return false; var w_zoom = Math.round((editor_w / bb.width)*100 * spacer)/100; var h_zoom = Math.round((editor_h / bb.height)*100 * spacer)/100; var zoomlevel = Math.min(w_zoom,h_zoom);