diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 9537b111..68827ae0 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1179,15 +1179,6 @@ function svg_edit_setup() { populateLayers(); function changeResolution(x,y) { - var new_res = x+'x'+y; - var found = false; - $('#resolution option').each(function() { - if($(this).text() == new_res) { - $('#resolution').val(x+'x'+y); - found = true; - } - }); - if(!found) $('#resolution').val('Custom'); var zoom = svgCanvas.getResolution().zoom; setResolution(x * zoom, y * zoom); } diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 5f16aae0..0bc5481f 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2906,9 +2906,8 @@ function BatchCommand(text) { svgroot.setAttribute('height', y); batchCmd.addSubCommand(new ChangeElementCommand(svgroot, {"width":w, "height":h})); - svgzoom.setAttribute("viewBox", ["0 0", x, y].join(' ')); + svgzoom.setAttribute("viewBox", ["0 0", x/current_zoom, y/current_zoom].join(' ')); batchCmd.addSubCommand(new ChangeElementCommand(svgzoom, {"viewBox": ["0 0", w, h].join(' ')})); - addCommandToHistory(batchCmd); svgroot.unsuspendRedraw(handle);