Skip to content

Commit 4860893

Browse files
committed
Revert "Try removing regl size check to see if it changes image export behavior"
This reverts commit 22362fb.
1 parent 22362fb commit 4860893

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/plot_api/plot_api.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -229,27 +229,27 @@ function _doPlot(gd, data, layout, config) {
229229
.style('width', fullLayout.width + 'px')
230230
.style('height', fullLayout.height + 'px');
231231

232-
// var regl = fullLayout._glcanvas.data()[0].regl;
233-
// if(regl) {
234-
// // Unfortunately, this can happen when relayouting to large
235-
// // width/height on some browsers.
236-
// if(Math.floor(fullLayout.width * plotGlPixelRatio) !== regl._gl.drawingBufferWidth ||
237-
// Math.floor(fullLayout.height * plotGlPixelRatio) !== regl._gl.drawingBufferHeight
238-
// ) {
239-
// var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';
240-
// if(drawFrameworkCalls) {
241-
// Lib.error(msg);
242-
// } else {
243-
// Lib.log(msg + ' Clearing graph and plotting again.');
244-
// Plots.cleanPlot([], {}, gd._fullData, fullLayout);
245-
// Plots.supplyDefaults(gd);
246-
// fullLayout = gd._fullLayout;
247-
// Plots.doCalcdata(gd);
248-
// drawFrameworkCalls++;
249-
// return drawFramework();
250-
// }
251-
// }
252-
// }
232+
var regl = fullLayout._glcanvas.data()[0].regl;
233+
if(regl) {
234+
// Unfortunately, this can happen when relayouting to large
235+
// width/height on some browsers.
236+
if(Math.floor(fullLayout.width * plotGlPixelRatio) !== regl._gl.drawingBufferWidth ||
237+
Math.floor(fullLayout.height * plotGlPixelRatio) !== regl._gl.drawingBufferHeight
238+
) {
239+
var msg = 'WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.';
240+
if(drawFrameworkCalls) {
241+
Lib.error(msg);
242+
} else {
243+
Lib.log(msg + ' Clearing graph and plotting again.');
244+
Plots.cleanPlot([], {}, gd._fullData, fullLayout);
245+
Plots.supplyDefaults(gd);
246+
fullLayout = gd._fullLayout;
247+
Plots.doCalcdata(gd);
248+
drawFrameworkCalls++;
249+
return drawFramework();
250+
}
251+
}
252+
}
253253
}
254254

255255
if(fullLayout.modebar.orientation === 'h') {

0 commit comments

Comments
 (0)