Fix line break issues with evolution screen

This commit is contained in:
Flashfyre 2024-04-07 21:18:52 -04:00
parent 0b773ee9c6
commit 13167a3901
1 changed files with 3 additions and 2 deletions

View File

@ -52,9 +52,10 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler {
// Predetermine overflow line breaks to avoid words breaking while displaying // Predetermine overflow line breaks to avoid words breaking while displaying
const textWords = text.split(' '); const textWords = text.split(' ');
let lastLineCount = 1; let lastLineCount = 1;
let newText = textWords[0]; let newText = '';
for (let w = 1; w < textWords.length; w++) { for (let w = 0; w < textWords.length; w++) {
const nextWordText = `${newText} ${textWords[w]}`; const nextWordText = `${newText} ${textWords[w]}`;
console.log(nextWordText);
if (textWords[w].includes('\n')) { if (textWords[w].includes('\n')) {
newText = nextWordText; newText = nextWordText;
lastLineCount++; lastLineCount++;