Famous / engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug?] Node (Render size mode) onSizeChange only triggered when the content is bigger.

elinfante opened this issue · comments

Hello,

I have a visualisation that moves words across the screen so I need to know the width of each word. To achieve that I use the component onSizeChange. Each word is set with render size mode. The first time I set the content It triggers the event for every word. It does work really well, the problem comes when the words get to the left of the screen then I need to change the content of each word. Only when the new content is bigger the onSizeChange component gets triggered therefore some words stay on the left and they get not triggered.

Is that a known issue? could you advise on what could I do to get the width every time please?

Thanks!

You can see a live version of the issue here:

http://www.buzzradar.com/test/juan/onsizechange/

(this = node)
function _addSizeComponent() {

    this.BZNO_FA_COMPONENT_SIZECHANGE.onSizeChange = function() {
        this.width = this.dom.getRenderSize()[0];
        this.height = this.dom.getRenderSize()[1];
        _setInitialPosition.call(this);
    }.bind(this);

    this.addComponent(this. BZNO_FA_COMPONENT_SIZECHANGE);

}

and this is how I set the new content of the word:

P04_WordCtrl_NODE.prototype.startWord = function (word_feed) {

    this.dom.setContent(word_feed);

};

Has the merged being succesful? I can see there was an error: https://travis-ci.org/Famous/engine/builds/79443728

Thanks for looking after this issue Alex.

We're running our tests via smokestack and Fx. Seems like WebGL isn't supported on the CI server.