Skip to content

Commit

Permalink
small cliprect improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Sword352 committed Feb 11, 2025
1 parent 9b2c998 commit 0225558
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions flixel/FlxSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ class FlxSprite extends FlxObject
_frame = FlxDestroyUtil.destroy(_frame);
_frameGraphic = FlxDestroyUtil.destroy(_frameGraphic);

clipRect = FlxDestroyUtil.put(clipRect);

shader = null;
}

Expand Down Expand Up @@ -1562,10 +1564,7 @@ class FlxSprite extends FlxObject
@:noCompletion
function set_clipRect(rect:FlxRect):FlxRect
{
if (rect != null)
clipRect = rect.round();
else
clipRect = null;
clipRect = rect;

if (frames != null)
frame = frames.frames[animation.frameIndex];
Expand Down

0 comments on commit 0225558

Please sign in to comment.