Browse Source

Remove prevChar Null<Int> alloc on splitRawText

Leonardo Jeanteur 4 months ago
parent
commit
1a67ca6f1a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      h2d/Text.hx

+ 1 - 0
h2d/Text.hx

@@ -316,6 +316,7 @@ class Text extends Drawable {
 	**/
 	@:dox(show)
 	function splitRawText( text : String, leftMargin = 0., afterData = 0., ?font : Font, ?sizes:Array<Float>, ?prevChar:Int = -1 ) {
+		var prevChar = prevChar ?? -1;
 		var maxWidth = realMaxWidth;
 		if( maxWidth < 0 ) {
 			if ( sizes == null )