From d514c9d9c670320115edcd8e2a47ccebaa216c98 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Thu, 10 Sep 2009 18:51:41 +0000 Subject: [PATCH] Made zoom center on image git-svn-id: http://svg-edit.googlecode.com/svn/trunk@621 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index a11a225a..7d56db42 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -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(){