From 791f1182cd7fb7740899e49a02025655e4a10a59 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 20 Feb 2017 10:14:26 +0100 Subject: [PATCH] modify resolveToReducedTrace --- src/ui/StepManager.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ui/StepManager.js b/src/ui/StepManager.js index cc7cdc4357..8f427e1f02 100644 --- a/src/ui/StepManager.js +++ b/src/ui/StepManager.js @@ -64,8 +64,13 @@ function StepManager (_parent, _traceManager) { StepManager.prototype.resolveToReducedTrace = function (value, incr) { if (this.parent.callTree.reducedTrace.length) { - var nextSource = utils.findLowerClosestBound(value, this.parent.callTree.reducedTrace) - nextSource = nextSource < this.parent.callTree.reducedTrace.length - 1 ? nextSource + incr : nextSource + var nextSource = utils.findClosestIndex(value, this.parent.callTree.reducedTrace) + nextSource = nextSource + incr + if (nextSource <= 0) { + nextSource = 0 + } else if (nextSource > this.parent.callTree.reducedTrace.length) { + nextSource = this.parent.callTree.reducedTrace.length - 1 + } return this.parent.callTree.reducedTrace[nextSource] } return value