Skip to content

Commit

Permalink
Fixed loadRotatedGraphic to solve Mod by 0 (#2518)
Browse files Browse the repository at this point in the history
Would happen if using a single-frame graphic image.

Error occurred *only* on Windows targets that I could see - not HashLink, or HTML5.
  • Loading branch information
SeiferTim authored Apr 13, 2022
1 parent b73c82d commit 68d26b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flixel/FlxSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ class FlxSprite extends FlxObject
// we assume that source graphic has one row frame animation with equal width and height
var brushSize:Int = brush.height;
var framesNum:Int = Std.int(brush.width / brushSize);
Frame = (framesNum > Frame) ? Frame : (Frame % framesNum);
Frame = (framesNum > Frame || framesNum == 0) ? Frame : (Frame % framesNum);
key += ":" + Frame;

var full:BitmapData = brush;
Expand Down

0 comments on commit 68d26b2

Please sign in to comment.