Skip to content

Commit b7d0240

Browse files
author
ElRoberto538
committed
Added Math.floor() to canvas properties for consistency
1 parent f45a99c commit b7d0240

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

dist/angular-pdf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
var setCanvasDimensions = function(canvas, w, h) {
2020
var ratio = backingScale(canvas);
21-
canvas.width = w * ratio;
22-
canvas.height = h * ratio;
21+
canvas.width = Math.floor(w * ratio);
22+
canvas.height = Math.floor(h * ratio);
2323
canvas.style.width = Math.floor(w) + 'px';
2424
canvas.style.height = Math.floor(h) + 'px';
2525
canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);

dist/angular-pdf.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/js/directives/angular-pdf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
var setCanvasDimensions = function(canvas, w, h) {
2020
var ratio = backingScale(canvas);
21-
canvas.width = w * ratio;
22-
canvas.height = h * ratio;
21+
canvas.width = Math.floor(w * ratio);
22+
canvas.height = Math.floor(h * ratio);
2323
canvas.style.width = Math.floor(w) + 'px';
2424
canvas.style.height = Math.floor(h) + 'px';
2525
canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);

0 commit comments

Comments
 (0)