Skip to content

Commit

Permalink
fix flash camera size (#3370)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Feb 18, 2025
1 parent 9875460 commit 46dabbb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions flixel/FlxCamera.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,13 @@ class FlxCamera extends FlxBasic
zoom = defaultZoom;

// Use the game dimensions if width / height are <= 0
this.width = width <= 0 ? Math.ceil(FlxG.width / zoom) : width;
this.height = height <= 0 ? Math.ceil(FlxG.height / zoom) : height;
if (width <= 0)
width = Math.ceil(FlxG.width / zoom);
if (height <= 0)
height = Math.ceil(FlxG.height / zoom);

this.width = width;
this.height = height;
_flashRect = new Rectangle(0, 0, width, height);

flashSprite.addChild(_scrollRect);
Expand Down

0 comments on commit 46dabbb

Please sign in to comment.