Skip to content

Commit 0147edc

Browse files
committed
ensure parcoords plotGlPixelRatio is within supported range of the device at plotly level
1 parent 4e65600 commit 0147edc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/traces/parcoords/lines.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,16 @@ module.exports = function(canvasGL, d) {
241241
var isPick = d.pick;
242242

243243
var regl = d.regl;
244-
var plotGlPixelRatio = 1; // d.viewModel.plotGlPixelRatio;
244+
var gl = regl._gl;
245+
var supportedLineWidth = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
246+
// ensure here that plotGlPixelRatio is within supported range; otherwise regl throws error
247+
var plotGlPixelRatio = Math.max(
248+
supportedLineWidth[0],
249+
Math.min(
250+
supportedLineWidth[1],
251+
d.viewModel.plotGlPixelRatio
252+
)
253+
);
245254

246255
var renderState = {
247256
currentRafs: {},

0 commit comments

Comments
 (0)