mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Ensure single chars are added to the layer
This commit is contained in:
parent
499a9b0146
commit
5f4d462144
1 changed files with 1 additions and 1 deletions
|
@ -974,13 +974,13 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
|
|||
}
|
||||
var textDiv = textDivs.shift();
|
||||
if (textDiv.dataset.textLength > 1) { // avoid div by zero
|
||||
textLayerDiv.appendChild(textDiv);
|
||||
// Adjust div width (via letterSpacing) to match canvas text
|
||||
// Due to the .offsetWidth calls, this is slow
|
||||
textDiv.style.letterSpacing =
|
||||
((textDiv.dataset.canvasWidth - textDiv.offsetWidth) /
|
||||
(textDiv.dataset.textLength - 1)) + 'px';
|
||||
}
|
||||
textLayerDiv.appendChild(textDiv);
|
||||
}
|
||||
renderTimer = setInterval(renderTextLayer, renderInterval);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue