draw-order fix for deeply-nested sprites
some explicit returns to avoid needless array creation