Update creator-23.js

This commit is contained in:
Kyle
2022-02-04 10:57:12 -08:00
parent bb72fae2ec
commit 44c7199999

View File

@@ -1218,6 +1218,7 @@ function writeText(textObject, targetContext) {
wordToWrite = word; wordToWrite = word;
} }
} }
//if the word goes past the max line width, go to the next line
if (wordToWrite && lineContext.measureText(wordToWrite).width + currentX >= textWidth && textArcRadius == 0) { if (wordToWrite && lineContext.measureText(wordToWrite).width + currentX >= textWidth && textArcRadius == 0) {
if (textOneLine && startingTextSize > 1) { if (textOneLine && startingTextSize > 1) {
//doesn't fit... try again at a smaller text size? //doesn't fit... try again at a smaller text size?
@@ -1226,6 +1227,7 @@ function writeText(textObject, targetContext) {
} }
newLine = true; newLine = true;
} }
//if we need a new line, go to the next line
if ((newLine && !textOneLine) || splitText.indexOf(word) == splitText.length - 1) { if ((newLine && !textOneLine) || splitText.indexOf(word) == splitText.length - 1) {
var horizontalAdjust = 0 var horizontalAdjust = 0
if (textAlign == 'center') { if (textAlign == 'center') {
@@ -1259,7 +1261,8 @@ function writeText(textObject, targetContext) {
newLineSpacing = (textObject.lineSpacing || 0) * textSize; newLineSpacing = (textObject.lineSpacing || 0) * textSize;
newLine = false; newLine = false;
} }
if (wordToWrite && (currentX != 0 || wordToWrite != ' ') && !textManaCost) { //if there's a word to write, it's not a space on a new line, and it's allowed to write words, then we write the word
if (wordToWrite && (currentX != startingCurrentX || wordToWrite != ' ') && !textManaCost) {
if (textArcRadius > 0) { if (textArcRadius > 0) {
lineContext.fillTextArc(wordToWrite, currentX + canvasMargin, canvasMargin + textSize * textFontHeightRatio + lineY, textArcRadius, textArcStart, currentX, textOutlineWidth); lineContext.fillTextArc(wordToWrite, currentX + canvasMargin, canvasMargin + textSize * textFontHeightRatio + lineY, textArcRadius, textArcStart, currentX, textOutlineWidth);
} else { } else {