Rounds page div to the canvas size
This commit is contained in:
parent
399463a450
commit
00852bd9ca
@ -1627,8 +1627,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
|
|||||||
var div = this.el = document.createElement('div');
|
var div = this.el = document.createElement('div');
|
||||||
div.id = 'pageContainer' + this.id;
|
div.id = 'pageContainer' + this.id;
|
||||||
div.className = 'page';
|
div.className = 'page';
|
||||||
div.style.width = this.viewport.width + 'px';
|
div.style.width = Math.floor(this.viewport.width) + 'px';
|
||||||
div.style.height = this.viewport.height + 'px';
|
div.style.height = Math.floor(this.viewport.height) + 'px';
|
||||||
|
|
||||||
container.appendChild(anchor);
|
container.appendChild(anchor);
|
||||||
container.appendChild(div);
|
container.appendChild(div);
|
||||||
@ -1652,8 +1652,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
|
|||||||
var viewport = this.pdfPage.getViewport(this.scale, totalRotation);
|
var viewport = this.pdfPage.getViewport(this.scale, totalRotation);
|
||||||
|
|
||||||
this.viewport = viewport;
|
this.viewport = viewport;
|
||||||
div.style.width = viewport.width + 'px';
|
div.style.width = Math.floor(viewport.width) + 'px';
|
||||||
div.style.height = viewport.height + 'px';
|
div.style.height = Math.floor(viewport.height) + 'px';
|
||||||
|
|
||||||
while (div.hasChildNodes())
|
while (div.hasChildNodes())
|
||||||
div.removeChild(div.lastChild);
|
div.removeChild(div.lastChild);
|
||||||
@ -1870,8 +1870,8 @@ var PageView = function pageView(container, pdfPage, id, scale,
|
|||||||
textLayerDiv ? new TextLayerBuilder(textLayerDiv, this.id - 1) : null;
|
textLayerDiv ? new TextLayerBuilder(textLayerDiv, this.id - 1) : null;
|
||||||
|
|
||||||
var scale = this.scale, viewport = this.viewport;
|
var scale = this.scale, viewport = this.viewport;
|
||||||
canvas.width = viewport.width;
|
canvas.width = Math.floor(viewport.width);
|
||||||
canvas.height = viewport.height;
|
canvas.height = Math.floor(viewport.height);
|
||||||
|
|
||||||
var ctx = canvas.getContext('2d');
|
var ctx = canvas.getContext('2d');
|
||||||
ctx.save();
|
ctx.save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user