Skip to content

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

Open

Description

@elinfante

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

};

Activity

  1. 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.[/+] on Aug 24, 2015
  2. added 2 commits that reference this issue on Sep 9, 2015
    dd73c5a
    90c1220
  3. elinfante commented on Sep 9, 2015

    @elinfante
    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.

  4. alexanderGugel commented on Sep 9, 2015

    @alexanderGugel
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions