Skip to content

Commit

Permalink
Merge pull request #67 from vikashdragongo/master
Browse files Browse the repository at this point in the history
Fixed zoom in & zoom out issue
  • Loading branch information
muaz-khan authored Mar 3, 2020
2 parents f5cf6fc + b7a000e commit 6822a57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dev/zoom-handler.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
var zoomHandler = {
scale: 1.0,
lastZoomState: null,
up: function(e) {
this.scale = this.lastZoomState !== 'up' ? 1 : this.scale;
this.scale += .01;
this.lastZoomState = 'up';
this.apply();
},
down: function(e) {
this.scale = this.lastZoomState !== 'down' ? 1 : this.scale;
this.scale -= .01;
this.lastZoomState = 'down';
this.apply();
},
apply: function() {
Expand All @@ -20,7 +25,7 @@ var zoomHandler = {
},
down: function(ctx) {
ctx.font = '22px Verdana';
ctx.strokeText('-', 15, 30);
ctx.strokeText('-', 10, 30);
}
}
};

0 comments on commit 6822a57

Please sign in to comment.