Made zoom center on image

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@621 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-09-10 18:51:41 +00:00
parent dad7b7f98b
commit d514c9d9c6
1 changed files with 5 additions and 0 deletions

View File

@ -941,6 +941,11 @@ function svg_edit_setup() {
function setResolution(w, h) {
$('#svgcanvas').css( { 'width': w, 'height': h } );
var w_area = $('#workarea');
var scroll_y = h/2 - w_area.height()/2;
var scroll_x = w/2 - w_area.width()/2;
w_area[0].scrollTop = scroll_y;
w_area[0].scrollLeft = scroll_x;
}
$('#resolution').change(function(){