client/js/renderer/viewrepr.js
changeset 557 18c36f038e9f
parent 554 32c7378d1c28
child 560 05a4380227f3
--- a/client/js/renderer/viewrepr.js	Wed Sep 30 16:33:38 2015 +0200
+++ b/client/js/renderer/viewrepr.js	Thu Oct 01 14:53:03 2015 +0200
@@ -161,11 +161,11 @@
                                        ]).multiply( 0.5 * ( 1 - Math.SQRT2 ) ).add(this.offset.multiply( Math.SQRT2 ));
             this.setScale( _newScale, _offset );
         },
-        resizeZoom: function(_scaleWidth, _scaleHeight, _ratio) {
-            var _newScale = this.scale * _ratio,
-                _offset = new paper.Point([
-                                       (this.offset.x * _scaleWidth),
-                                       (this.offset.y * _scaleHeight)
+        resizeZoom: function(deltaW, deltaH, _ratio) {
+            var _newScale = this.scale * _ratio;
+            var _offset = new paper.Point([
+                                       (this.renderer.canvas_$.width() * 0.5 * ( 1 - _ratio) ) + (this.offset.x * _ratio + deltaW * _ratio * 0.5 ),
+                                       (this.renderer.canvas_$.height() * 0.5 * ( 1 - _ratio) ) + (this.offset.y * _ratio + deltaH * _ratio * 0.5 )
                                        ]);
             this.setScale( _newScale, _offset );
         },