mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge pull request #3746 from JakubValtar/text-fix
Render text starting with space properly
This commit is contained in:
@@ -4708,10 +4708,11 @@ public class PGraphics extends PImage implements PConstants {
|
||||
// boundary of a word or end of this sentence
|
||||
if ((buffer[index] == ' ') || (index == stop)) {
|
||||
// System.out.println((index == stop) + " " + wordStart + " " + index);
|
||||
if (start != stop && wordStart == index) { // end of line, nothing is fitting
|
||||
return false;
|
||||
float wordWidth = 0;
|
||||
if (index > wordStart) {
|
||||
// we have a non-empty word, measure it
|
||||
wordWidth = textWidthImpl(buffer, wordStart, index);
|
||||
}
|
||||
float wordWidth = textWidthImpl(buffer, wordStart, index);
|
||||
|
||||
if (runningX + wordWidth >= boxWidth) {
|
||||
if (runningX != 0) {
|
||||
|
||||
Reference in New Issue
Block a user