diff --git a/CanvasTextWrapper.js b/CanvasTextWrapper.js index d199c59..8a73d3b 100644 --- a/CanvasTextWrapper.js +++ b/CanvasTextWrapper.js @@ -68,13 +68,11 @@ // use previous font size, not the one that broke the while condition this.setFontSize(--fontSize); - var lines = this.getWrappedText(elementWidth); - var textBlockHeight = lines.length * this.lineHeight; - } else { - var lines = this.getWrappedText(elementWidth); - var textBlockHeight = lines.length * this.lineHeight; } + var lines = this.getWrappedText(elementWidth); + var textBlockHeight = lines.length * this.lineHeight; + // set vertical align for the whole text block this.setTextVerticalAlign(textPos, textBlockHeight);