1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00

Merge pull request #2228 from yurydelendik/fix-white-border

Rounding page div width and height...
This commit is contained in:
Brendan Dahl 2012-10-10 17:32:16 -07:00
commit 115f00cf4c

View file

@ -1631,8 +1631,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
var div = this.el = document.createElement('div');
div.id = 'pageContainer' + this.id;
div.className = 'page';
div.style.width = this.viewport.width + 'px';
div.style.height = this.viewport.height + 'px';
div.style.width = Math.floor(this.viewport.width) + 'px';
div.style.height = Math.floor(this.viewport.height) + 'px';
container.appendChild(anchor);
container.appendChild(div);
@ -1656,8 +1656,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
var viewport = this.pdfPage.getViewport(this.scale, totalRotation);
this.viewport = viewport;
div.style.width = viewport.width + 'px';
div.style.height = viewport.height + 'px';
div.style.width = Math.floor(viewport.width) + 'px';
div.style.height = Math.floor(viewport.height) + 'px';
while (div.hasChildNodes())
div.removeChild(div.lastChild);
@ -1874,8 +1874,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
textLayerDiv ? new TextLayerBuilder(textLayerDiv, this.id - 1) : null;
var scale = this.scale, viewport = this.viewport;
canvas.width = viewport.width;
canvas.height = viewport.height;
canvas.width = Math.floor(viewport.width);
canvas.height = Math.floor(viewport.height);
var ctx = canvas.getContext('2d');
ctx.save();