bug fix for text() getting smashed together

This commit is contained in:
benfry
2005-03-02 22:10:00 +00:00
parent 58856c61a8
commit c7a4f54f57
3 changed files with 34 additions and 6 deletions

View File

@@ -631,7 +631,7 @@ public class PFont implements PConstants {
for (int index = start; index < stop; index++) {
textImpl(textBuffer[index], x, y, z, parent);
x += width(textBuffer[index]);
x += parent.textSize * width(textBuffer[index]);
}
}
@@ -688,7 +688,8 @@ public class PFont implements PConstants {
if ((textBuffer[index] == ' ') ||
(index == length-1)) {
// boundary of a word
float wordWidth = calcWidth(textBuffer, wordStart, index);
float wordWidth = parent.textSize *
calcWidth(textBuffer, wordStart, index);
if (runningX + wordWidth > boxX2) {
if (runningX == boxX1) {
// if this is the first word, and its width is
@@ -701,7 +702,8 @@ public class PFont implements PConstants {
// not a single char will fit on this line. screw 'em.
return;
}
wordWidth = calcWidth(textBuffer, wordStart, index);
wordWidth = parent.textSize *
calcWidth(textBuffer, wordStart, index);
} while (wordWidth > boxWidth);
textLine(lineStart, index, lineX, currentY, boxZ, parent);