Skip to content

Commit 46dabbb

Browse files
authored
fix flash camera size (#3370)
1 parent 9875460 commit 46dabbb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

flixel/FlxCamera.hx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,8 +1016,13 @@ class FlxCamera extends FlxBasic
10161016
zoom = defaultZoom;
10171017

10181018
// Use the game dimensions if width / height are <= 0
1019-
this.width = width <= 0 ? Math.ceil(FlxG.width / zoom) : width;
1020-
this.height = height <= 0 ? Math.ceil(FlxG.height / zoom) : height;
1019+
if (width <= 0)
1020+
width = Math.ceil(FlxG.width / zoom);
1021+
if (height <= 0)
1022+
height = Math.ceil(FlxG.height / zoom);
1023+
1024+
this.width = width;
1025+
this.height = height;
10211026
_flashRect = new Rectangle(0, 0, width, height);
10221027

10231028
flashSprite.addChild(_scrollRect);

0 commit comments

Comments
 (0)