maxkrieger / aframe-draw-component

HTML5 canvas component for AFrame VR.
http://a9.io/aframe-draw-component/
57 stars 8 forks source link

[bugfix] Call update from init lifecycle method. #5

Closed Goblinlordx closed 8 years ago

Goblinlordx commented 8 years ago

This actually might be an aframe problem but doing this prevents the error. The actual problem was render() was being called prior to the canvas element being created.

Based on the aframe docs (https://aframe.io/docs/0.2.0/core/component.html#component-update-olddata) Update() should be called at the "beginning of a component's lifecycle" (presumably before first render. This points to a possible problem in aframe rather than this component.

Closes maxkrieger/aframe-textwrap-component#3

maxkrieger commented 8 years ago

Looks like everything's working! Going to bump the version now.

maxkrieger commented 8 years ago

All set, thanks so much! Fixed in npm v1.5.0.