craftyjs / Crafty

JavaScript Game Engine
http://craftyjs.com
MIT License
3.39k stars 561 forks source link

Update dependent positions on origin change #1202

Closed starwed closed 5 years ago

starwed commented 5 years ago

Setting the origin 'mid scene' was not properly updating the overall entity state.

When the origin of a rotated entity changes, we need to:

starwed commented 5 years ago

This should fix #1201, and might also resolve #1200. (For the latter, it could be that the MBR/map not being updated upon setting the origin could cause a rotated entity on the edge of the view to not be rendered -- the pre origin change position would have been off of the screen)