Skip to content

Commit 0f82b9b

Browse files
committed
Revert "fix to processing#8469 in dev-2.0"
This reverts commit 67bd05b.
1 parent 67bd05b commit 0f82b9b

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/type/textCore.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,11 +1790,6 @@ function textCore(p5, fn) {
17901790
return { bounds, lines };
17911791
};
17921792

1793-
Renderer.prototype._trimEnd = function (str) {
1794-
// trim trailing linebreaks and whitespace only
1795-
return str.replace(/[\s\n]+$/, '');
1796-
};
1797-
17981793
/*
17991794
Adjust width, height of bounds based on current rectMode
18001795
* @private
@@ -2252,13 +2247,13 @@ function textCore(p5, fn) {
22522247
testLine = `${line + words[widx]}` + splitter;
22532248
testWidth = this._textWidthSingle(testLine);
22542249
if (line.length > 0 && testWidth > maxWidth) {
2255-
newLines.push(this._trimEnd(line));
2250+
newLines.push(line.trim());
22562251
line = `${words[widx]}` + splitter;
22572252
} else {
22582253
line = testLine;
22592254
}
22602255
}
2261-
newLines.push(this._trimEnd(line));
2256+
newLines.push(line.trim());
22622257
}
22632258
return newLines;
22642259
};

0 commit comments

Comments
 (0)