Closed khcyt closed 3 years ago
Thanks for pointing this out. Only window objects emit resize events these days, so the _this.domElement.addEventListener( 'resize', onWindowResize );
line does nothing.
So on resizing the element with the three.js renderer, the app code should call onWindowResize on the SpinControls object.
The problem, however, is that the global function onWindowResize usually doesn't exist. The result is a JavaScript runtime error. Therefore I have to define this function explicitly.
Again, thanks for this =). If the error does not fire when I open the examples.html locally, I probably don't know about it.
Thanks for the fix. In your example html file there is a global function onWindowResize(). Because of this, it works with no problem. I want to use CameraSpinControl and SpinControl in my project (thanks for publishing the source files). In my project there is no onWindowResize() function by default. With your fix, it's now working fine.
Hello, SpinControl class expects a global function onWindowResize (line 627/639 in SpinControl.js). Is that correct? In class SpinControl only function this.onWindowResize() exists. The readme file says that the user should call SpinControl.onWindowResize().