Tweaked layer order updating to fallback to sorting by x if y and z are the same.

This commit is contained in:
Scott Erickson 2014-02-06 13:22:47 -08:00
parent 332ea0df2c
commit 6484f787c5

View file

@ -69,7 +69,7 @@ module.exports = class Layer extends createjs.Container
bz = if b.z then b.z else 1000
if az == bz
return 0 unless a.sprite?.thang?.pos and b.sprite?.thang?.pos
return b.sprite.thang.pos.y - a.sprite.thang.pos.y
return (b.sprite.thang.pos.y - a.sprite.thang.pos.y) or (b.sprite.thang.pos.x - a.sprite.thang.pos.x)
return az - bz
onZoomUpdated: (e) ->