Fix issue w/ textlayer on retina causing it to be visible only in top quadrant

This commit is contained in:
Mack Duan 2013-03-25 11:32:51 -07:00
parent 3796f2496f
commit 7aaa061db4

View File

@ -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) + ')';