From 5f4d462144747c19c9dd41facb7ed18d98202d40 Mon Sep 17 00:00:00 2001 From: Artur Adib Date: Wed, 18 Jan 2012 11:41:13 -0500 Subject: [PATCH] Ensure single chars are added to the layer --- web/viewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/viewer.js b/web/viewer.js index 72c154bc1..319946ce6 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -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);