Fix clouds3d: temporal dead zone on 's' variable
loadImageTexture(s.gl, ...) referenced 's' before its 'var s = canvas.__state' declaration later in the function. Used canvas.__state.gl directly since __state was just assigned.
This commit is contained in:
1 parent
40fcea0548
commit
c9159a8876
1 file changed
+1
-1
Vendored
+1
-1
@@ -311,7 +311,7 @@ window.clouds3dRender = function(target) {
|
|||||||
// frames render normally before it loads — the shader just
|
// frames render normally before it loads — the shader just
|
||||||
// samples a black texture in the meantime.
|
// samples a black texture in the meantime.
|
||||||
canvas.__groundReady = false;
|
canvas.__groundReady = false;
|
||||||
loadImageTexture(s.gl, 'ground.jpg').then(function(tex) {
|
loadImageTexture(canvas.__state.gl, 'ground.jpg').then(function(tex) {
|
||||||
canvas.__ground = tex;
|
canvas.__ground = tex;
|
||||||
canvas.__groundReady = true;
|
canvas.__groundReady = true;
|
||||||
}).catch(function(err) {
|
}).catch(function(err) {
|
||||||
|
|||||||
Reference in new issue
Block a user