Skip to content

Commit 3879a41

Browse files
committed
use scope variable instead of fullLayout private key
... to avoid infinite drawFramework loops
1 parent 6fcec6e commit 3879a41

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/plot_api/plot_api.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ exports.plot = function(gd, data, layout, config) {
199199

200200
// draw framework first so that margin-pushing
201201
// components can position themselves correctly
202+
var drawFrameworkCalls = 0;
202203
function drawFramework() {
203204
var basePlotModules = fullLayout._basePlotModules;
204205

@@ -251,15 +252,15 @@ exports.plot = function(gd, data, layout, config) {
251252
fullLayout.height !== regl._gl.drawingBufferHeight
252253
) {
253254
var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';
254-
if(fullLayout._redrawFromWrongGlDimensions) {
255+
if(drawFrameworkCalls) {
255256
Lib.error(msg);
256257
} else {
257258
Lib.log(msg + ' Clearing graph and plotting again.');
258259
Plots.cleanPlot([], {}, gd._fullData, fullLayout, gd.calcdata);
259260
Plots.supplyDefaults(gd);
260261
fullLayout = gd._fullLayout;
261262
Plots.doCalcdata(gd);
262-
fullLayout._redrawFromWrongGlDimensions = 1;
263+
drawFrameworkCalls++;
263264
return drawFramework();
264265
}
265266
}

test/jasmine/tests/splom_test.js

-2
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ describe('Test splom interactions:', function() {
717717
});
718718
assertDims('base', 600, 500);
719719
expect(Lib.log).toHaveBeenCalledTimes(0);
720-
expect(gd._fullLayout._redrawFromWrongGlDimensions).toBeUndefined();
721720

722721
spyOn(gd._fullData[0]._module, 'plot').and.callThrough();
723722

@@ -732,7 +731,6 @@ describe('Test splom interactions:', function() {
732731
assertDims('after', 4810, 3656);
733732
expect(Lib.log)
734733
.toHaveBeenCalledWith('WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug. Clearing graph and plotting again.');
735-
expect(gd._fullLayout._redrawFromWrongGlDimensions).toBe(1);
736734
})
737735
.catch(failTest)
738736
.then(done);

0 commit comments

Comments
 (0)