Skip to content

Commit

Permalink
Added Math.floor() to canvas properties for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ElRoberto538 committed Sep 14, 2015
1 parent f45a99c commit b7d0240
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/angular-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

var setCanvasDimensions = function(canvas, w, h) {
var ratio = backingScale(canvas);
canvas.width = w * ratio;
canvas.height = h * ratio;
canvas.width = Math.floor(w * ratio);
canvas.height = Math.floor(h * ratio);
canvas.style.width = Math.floor(w) + 'px';
canvas.style.height = Math.floor(h) + 'px';
canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-pdf.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/js/directives/angular-pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

var setCanvasDimensions = function(canvas, w, h) {
var ratio = backingScale(canvas);
canvas.width = w * ratio;
canvas.height = h * ratio;
canvas.width = Math.floor(w * ratio);
canvas.height = Math.floor(h * ratio);
canvas.style.width = Math.floor(w) + 'px';
canvas.style.height = Math.floor(h) + 'px';
canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);
Expand Down

0 comments on commit b7d0240

Please sign in to comment.