play-co / timestep

GNU General Public License v3.0
16 stars 27 forks source link

enforce style.centerAnchor on width / height change #81

Closed rogueSkib closed 8 years ago

jishnu7 commented 8 years ago

So this will make centerAnchor default in box layout is it?

rogueSkib commented 8 years ago

No, centerAnchor is false by default: https://github.com/gameclosure/timestep/blob/master/src/ui/backend/BaseBacking.js#L39

This PR makes centerAnchor work regardless of layout; whenever style.width or style.height are updated, the anchors will also update. The BoxLayout code skips the _onResize handler, so we have to include the check there as well, like you had in your original PR.