Famous / engine

MIT License
1.75k stars 250 forks source link

[Bug?] onUpdate fires continuously despite not calling requestUpdate or requestUpdateOnNextTick #494

Open artichox opened 8 years ago

artichox commented 8 years ago

I don't know where or why onUpdate is being triggered, but you can see in this working example that the onUpdate in the CurriculumMenu is being called continuously. In no onUpdate callbacks do I call requestUpdate or requestUpdateOnNextTick.

https://github.com/artichox/example-of-famous-onupdate-bug

trusktr commented 8 years ago

I think that's a bug. What happens if instead of passing this (@) into the requestUpdateOnNextTick call you make a component, then pass the component ID into requestUpdateOnNextTick (hen you add the component with addComponent, it returns the component ID).

Arnleif commented 8 years ago

Hi. I wanted to report a bug I've found related to update/onupdate and then I saw your problem.

in core/Transform.js multiply (out, a, b) function (In Famous)

there are lines like this: changed = changed ? changed : out[0] === res;

which is wrong as changed will be true if there were no changes. out[0] !== res; would be correct, and that stops the updates from being called again each frame.

A