From ed21dd6c195be449dcdda8870bb7a273dcddfa2f Mon Sep 17 00:00:00 2001 From: ivmartel Date: Tue, 28 Apr 2015 23:27:42 +0200 Subject: [PATCH] Floor the application scale to avoid too small image and negative value (causing image flip). Fixes #134. --- src/app/application.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/application.js b/src/app/application.js index 2a15012608..3d06ec483e 100644 --- a/src/app/application.js +++ b/src/app/application.js @@ -731,6 +731,9 @@ dwv.App = function () */ this.zoom = function (zoom, cx, cy) { scale = zoom * windowScale; + if ( scale <= 0.1 ) { + scale = 0.1; + } scaleCenter = {"x": cx, "y": cy}; zoomLayers(); }; @@ -744,6 +747,9 @@ dwv.App = function () */ this.stepZoom = function (step, cx, cy) { scale += step; + if ( scale <= 0.1 ) { + scale = 0.1; + } scaleCenter = {"x": cx, "y": cy}; zoomLayers(); };