Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Oct 7, 2024
1 parent 03ce4ce commit cbca9ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gameobjects/text/GetTextSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ var GetTextSize = function (text, size, lines)
lineWidth += context.measureText(line[j]).width;
}

lineWidth += letterSpacing * (line.length - 1);
if (line.length > 1)
{
lineWidth += letterSpacing * (line.length - 1);
}
}

// Adjust for wrapped text
Expand Down

0 comments on commit cbca9ec

Please sign in to comment.