Skip to content

Commit 2c8a290

Browse files
committed
aj-proof downward line position loop
1 parent 5441ef9 commit 2c8a290

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/traces/scattergl/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function plot(gd, subplot, cdata) {
402402
firstptdef += 2;
403403
}
404404
var lastptdef = srcPos.length - 2;
405-
while(lastptdef > -1 && (isNaN(srcPos[lastptdef]) || isNaN(srcPos[lastptdef + 1]))) {
405+
while(lastptdef > firstptdef && (isNaN(srcPos[lastptdef]) || isNaN(srcPos[lastptdef + 1]))) {
406406
lastptdef -= 2;
407407
}
408408
lineOptions.positions = srcPos.slice(firstptdef, lastptdef + 2);
@@ -446,7 +446,7 @@ function plot(gd, subplot, cdata) {
446446
firstptdef += 2;
447447
}
448448
lastptdef = srcPos.length - 2;
449-
while(lastptdef > -1 && isNaN(srcPos[lastptdef + 1])) {
449+
while(lastptdef > firstptdef && isNaN(srcPos[lastptdef + 1])) {
450450
lastptdef -= 2;
451451
}
452452
if(srcPos[firstptdef + 1] !== 0) {
@@ -463,7 +463,7 @@ function plot(gd, subplot, cdata) {
463463
firstptdef += 2;
464464
}
465465
lastptdef = srcPos.length - 2;
466-
while(lastptdef > -1 && isNaN(srcPos[lastptdef])) {
466+
while(lastptdef > firstptdef && isNaN(srcPos[lastptdef])) {
467467
lastptdef -= 2;
468468
}
469469
if(srcPos[firstptdef] !== 0) {

0 commit comments

Comments
 (0)