Additional fixes to resolution change, now works correctly when zoomed

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@678 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-09-22 17:46:44 +00:00
parent e7941f5df8
commit 920a5df480
2 changed files with 1 additions and 11 deletions

View File

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

View File

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