Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
elinfante opened this issue Aug 20, 2015 · 2 comments

Comments

@elinfante
Copy link

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);

};
@elinfante elinfante changed the title Node (Render size mode) onSizeChange only triggered when the content is bigger. [bug?] Node (Render size mode) onSizeChange only triggered when the content is bigger. Aug 24, 2015
alexanderGugel added a commit to alexanderGugel/engine that referenced this issue Sep 9, 2015
onSizeChange hasn't been called.

Fixes Famous#476
alexanderGugel added a commit to alexanderGugel/engine that referenced this issue Sep 9, 2015
onSizeChange hasn't been called.

Fixes Famous#476
@elinfante
Copy link
Author

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.

@alexanderGugel
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants