fix null error in GroupTools
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
|
||||
(function :FlxRect calculateScreenBounds <>[:FlxSprite T] [:FlxTypedGroup<T> group &opt :FlxCamera camera :Float margin]
|
||||
(unless margin (set margin 0))
|
||||
(let [s (group.getFirstAlive)
|
||||
r (new FlxRect)
|
||||
(ifLet [s (group.getFirstAlive)]
|
||||
(let [r (new FlxRect)
|
||||
bounds (s.getScreenBounds r camera)
|
||||
&mut minX bounds.left
|
||||
&mut maxX bounds.right
|
||||
@@ -35,4 +35,5 @@
|
||||
|
||||
(r.fromTwoPoints
|
||||
(new FlxPoint (- minX margin) (- minY margin))
|
||||
(new FlxPoint (+ maxX margin) (+ maxY margin)))))
|
||||
(new FlxPoint (+ maxX margin) (+ maxY margin))))
|
||||
(new FlxRect 0 0 0 0)))
|
Reference in New Issue
Block a user