Prevented NaN values when selecting fit-to zoom options, made first layer be renamed on language change

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1107 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-12-23 20:29:44 +00:00
parent f96bb53c40
commit e4805a123f
2 changed files with 10 additions and 0 deletions

View File

@ -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();
}
}
};

View File

@ -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);