Fix issue w/ textlayer on retina causing it to be visible only in top quadrant
This commit is contained in:
parent
3796f2496f
commit
7aaa061db4
@ -2116,20 +2116,22 @@ var PageView = function pageView(container, pdfPage, id, scale,
|
||||
div.appendChild(canvas);
|
||||
this.canvas = canvas;
|
||||
|
||||
var textLayerDiv = null;
|
||||
if (!PDFJS.disableTextLayer) {
|
||||
textLayerDiv = document.createElement('div');
|
||||
textLayerDiv.className = 'textLayer';
|
||||
div.appendChild(textLayerDiv);
|
||||
}
|
||||
var textLayer = this.textLayer =
|
||||
textLayerDiv ? new TextLayerBuilder(textLayerDiv, this.id - 1) : null;
|
||||
|
||||
var scale = this.scale, viewport = this.viewport;
|
||||
var outputScale = PDFView.getOutputScale();
|
||||
canvas.width = Math.floor(viewport.width) * outputScale.sx;
|
||||
canvas.height = Math.floor(viewport.height) * outputScale.sy;
|
||||
|
||||
var textLayerDiv = null;
|
||||
if (!PDFJS.disableTextLayer) {
|
||||
textLayerDiv = document.createElement('div');
|
||||
textLayerDiv.className = 'textLayer';
|
||||
textLayerDiv.style.width = canvas.width + 'px';
|
||||
textLayerDiv.style.height = canvas.height + 'px';
|
||||
div.appendChild(textLayerDiv);
|
||||
}
|
||||
var textLayer = this.textLayer =
|
||||
textLayerDiv ? new TextLayerBuilder(textLayerDiv, this.id - 1) : null;
|
||||
|
||||
if (outputScale.scaled) {
|
||||
var cssScale = 'scale(' + (1 / outputScale.sx) + ', ' +
|
||||
(1 / outputScale.sy) + ')';
|
||||
|
Loading…
Reference in New Issue
Block a user