Skip to content

Commit

Permalink
Fixes width of line after \n character.
Browse files Browse the repository at this point in the history
When \n character is there in a string, calculation of width for very
next line after \n was wrong.

This commit fixes issue play-co#23.
  • Loading branch information
jishnu7 committed Oct 22, 2013
1 parent 9ab8cd0 commit 661bca5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ui/backend/canvas/TextFlow.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ var TextFlow = exports = Class(PubSub, function (supr) {
if (word.word === "\n") {
lines.push([{word: s, width: currentWidth, line: lines.length}]);
s = "";
currentWidth = 0;
} else {
var isLineEmpty = !s.length;
var hasSpace = !isLineEmpty && !this._opts.wrapCharacter;
Expand Down

0 comments on commit 661bca5

Please sign in to comment.