Fix particle box

- fix bug that memory writes in setAsLastFrame and setAsFirstFrame are not in order

This bug was not triggered by the current `dev` or `master` branche.