Skip to content

Commit

Permalink
Regen graphic in FlxText.getScreenBounds() (#2942)
Browse files Browse the repository at this point in the history
* Regen graphic in `FlxText.getScreenBounds()`

* small style changes

---------

Co-authored-by: George FunBook <[email protected]>
  • Loading branch information
T1mL3arn and Geokureli authored Oct 18, 2023
1 parent f7c0915 commit 6a72309
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flixel/text/FlxText.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package flixel.text;

import openfl.Assets;
import openfl.display.BitmapData;
import openfl.geom.ColorTransform;
import openfl.text.TextField;
Expand All @@ -14,11 +15,11 @@ import flixel.graphics.atlas.FlxNode;
import flixel.graphics.frames.FlxFramesCollection;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets;
import flixel.util.FlxColor;
import flixel.util.FlxDestroyUtil;
import flixel.util.helpers.FlxRange;
import openfl.Assets;

using flixel.util.FlxStringUtil;
using flixel.util.FlxUnicodeUtil;
Expand Down Expand Up @@ -537,6 +538,12 @@ class FlxText extends FlxSprite
super.updateHitbox();
}

override function getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera):FlxRect
{
regenGraphic();
return super.getScreenBounds(newRect, camera);
}

function set_fieldWidth(value:Float):Float
{
if (textField == null)
Expand Down

0 comments on commit 6a72309

Please sign in to comment.