-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Wrong WebGLRenderingContext interface definition for pixelStorei #27542
Comments
Out of curiosity, I wonder how this could creep back in a second time? |
What is the recommended workaround until this is fixed? Not sure how to override this locally.. |
Wrong WebGLRenderingContext interface definition for pixelStorei
Created a pull request to fix #28591. |
@dakom as a workaround we use 0 for false and 1 for true, not a 100% sure though if it works correctly |
It works, and you can also convert boolean to a number. gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true); // error TS2345
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 1); // ok
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, +true); // ok
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false); // error TS2345
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, 0); // ok
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, +false); // ok |
TypeScript Version: 3.1.1
Search Terms:
WebGLRenderingContext
pixelStorei
Code
Expected behavior:
well compiled
Actual behavior:
TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
pixelStorei definition in lib.dom.d.ts (in 3.1-rc and 3.1.1) :
should be :
In 3.0.3, pixelStorei definition was :
The text was updated successfully, but these errors were encountered: