Skip to content

Commit 713b42a

Browse files
authored
Merge pull request #4256 from plotly/gl3d-chrome-77
Enable second try to create gl3d scenes for Chrome 77 webgl bug
2 parents 75d007e + f065d3b commit 713b42a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/plots/gl3d/scene.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,20 @@ function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) {
230230
glplotOptions.canvas = STATIC_CANVAS;
231231
}
232232

233+
var failed = 0;
234+
233235
try {
234236
scene.glplot = createPlot(glplotOptions);
235237
} catch(e) {
236-
return false;
238+
failed++;
239+
try { // try second time to fix issue with Chrome 77 https://github.com/plotly/plotly.js/issues/4233
240+
scene.glplot = createPlot(glplotOptions);
241+
} catch(e) {
242+
failed++;
243+
}
237244
}
238245

239-
return true;
246+
return failed < 2;
240247
}
241248

242249
function initializeGLPlot(scene, pixelRatio, canvas, gl) {

0 commit comments

Comments
 (0)