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]
|
(function :FlxRect calculateScreenBounds <>[:FlxSprite T] [:FlxTypedGroup<T> group &opt :FlxCamera camera :Float margin]
|
||||||
(unless margin (set margin 0))
|
(unless margin (set margin 0))
|
||||||
(let [s (group.getFirstAlive)
|
(ifLet [s (group.getFirstAlive)]
|
||||||
r (new FlxRect)
|
(let [r (new FlxRect)
|
||||||
bounds (s.getScreenBounds r camera)
|
bounds (s.getScreenBounds r camera)
|
||||||
&mut minX bounds.left
|
&mut minX bounds.left
|
||||||
&mut maxX bounds.right
|
&mut maxX bounds.right
|
||||||
@@ -35,4 +35,5 @@
|
|||||||
|
|
||||||
(r.fromTwoPoints
|
(r.fromTwoPoints
|
||||||
(new FlxPoint (- minX margin) (- minY margin))
|
(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