reviewer comments

This commit is contained in:
Artur Adib 2012-01-19 09:11:48 -05:00
parent 1c7f1b9881
commit ba4f0e66aa

View File

@ -979,7 +979,7 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
if (textDiv.dataset.textLength > 1) { // avoid div by zero if (textDiv.dataset.textLength > 1) { // avoid div by zero
// Adjust div width (via letterSpacing) to match canvas text // Adjust div width (via letterSpacing) to match canvas text
// Due to the .offsetWidth calls, this is slow // Due to the .offsetWidth calls, this is slow
// **This needs to come after appending to the DOM** // This needs to come after appending to the DOM
textDiv.style.letterSpacing = textDiv.style.letterSpacing =
((textDiv.dataset.canvasWidth - textDiv.offsetWidth) / ((textDiv.dataset.canvasWidth - textDiv.offsetWidth) /
(textDiv.dataset.textLength - 1)) + 'px'; (textDiv.dataset.textLength - 1)) + 'px';
@ -1001,7 +1001,7 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
clearInterval(renderTimer); clearInterval(renderTimer);
clearTimeout(scrollTimer); clearTimeout(scrollTimer);
scrollTimer = setTimeout(function() { scrollTimer = setTimeout(function textLayerScrollTimer() {
// Resume rendering // Resume rendering
renderTimer = setInterval(renderTextLayer, renderInterval); renderTimer = setInterval(renderTextLayer, renderInterval);
}, resumeInterval); }, resumeInterval);