play-co / devkit

HTML 5 game platform for browser and mobile
http://docs.gameclosure.com
627 stars 126 forks source link

centerAnchor is not working #199

Open jwilm opened 9 years ago

jwilm commented 9 years ago

Originally created by @jishnu7 before the devkit2 repo merge

centerAnchor supposed to recenter the view on dimension change. But, manually specifying anchorX and anchorY works fine.

code to reproduce the issue.

import ui.View as View;
import animate

exports = Class(GC.Application, function () {
  this.initUI = function () {
    var view = new View({
      superview: this.view,
      backgroundColor: "white",
      layout: 'box',
      x: 100,
      y: 100,
      width: 100,
      height: 100,
      centerAnchor: true
    });

    setInterval(function () {
      animate(view).then({
        height: 200,
        width: 200
      }, 1000).then({
        height: 50,
        width: 50
      }, 1000);
    }, 2000);
  };
});
jwilm commented 9 years ago

@jishnu7 has a fix on timestep