Skip to content

Commit

Permalink
Floor the application scale to avoid too small image and negative value
Browse files Browse the repository at this point in the history
(causing image flip). Fixes #134.
  • Loading branch information
ivmartel committed Apr 28, 2015
1 parent f895118 commit ed21dd6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
};
Expand All @@ -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();
};
Expand Down

0 comments on commit ed21dd6

Please sign in to comment.