Skip to content

Commit cb81814

Browse files
committed
fixing a repaint bug esp. visible with low dimension count e.g. 2 (also known as slope diagram)
(cherry picked from commit 0e3fa92)
1 parent e4b5c8c commit cb81814

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/traces/parcoords/lines.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ module.exports = function(canvasGL, lines, canvasWidth, canvasHeight, dimensions
287287
return dimensions[index];
288288
}
289289

290-
var leftmostIndex, rightmostIndex, lowestX = Infinity, highestX = -Infinity;
290+
var leftmost, rightmost, lowestX = Infinity, highestX = -Infinity;
291291
for(I = 0; I < panelCount; I++) {
292292
if(dimensions[I].canvasX > highestX) {
293293
highestX = dimensions[I].canvasX;
294-
rightmostIndex = I;
294+
rightmost = I;
295295
}
296296
if(dimensions[I].canvasX < lowestX) {
297297
lowestX = dimensions[I].canvasX;
298-
leftmostIndex = I;
298+
leftmost = I;
299299
}
300300
}
301301

@@ -342,8 +342,8 @@ module.exports = function(canvasGL, lines, canvasWidth, canvasHeight, dimensions
342342

343343
colorClamp: colorClamp,
344344
scatter: scatter || 0,
345-
scissorX: I === leftmostIndex ? 0 : x + overdrag,
346-
scissorWidth: I === rightmostIndex ? 2 * panelSizeX + overdrag + (I === leftmostIndex ? x + overdrag : 0) : panelSizeX + 1 + (I === leftmostIndex ? x + overdrag : 0)
345+
scissorX: I === leftmost ? 0 : x + overdrag,
346+
scissorWidth: (I === rightmost ? canvasWidth - x + overdrag : panelSizeX + 0.5) + (I === leftmost ? x + overdrag : 0)
347347
};
348348
}
349349

0 commit comments

Comments
 (0)