File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } ;
You can’t perform that action at this time.
0 commit comments