Fix gitGraph findLane function error

findLane may infinite loop after recursive call, then cause RangeError: Maximum call stack size exceeded.
This commit is contained in:
hughligit 2022-08-31 16:51:36 +08:00 committed by GitHub
parent 5b63260240
commit 9d5e855e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -336,7 +336,7 @@ const findLane = (y1, y2, _depth) => {
return candidate;
}
const diff = Math.abs(y1 - y2);
return findLane(y1, y2 - diff / 5, depth);
return findLane(y1, y2 - diff / 5, depth + 1);
};
/**