modify resolveToReducedTrace

pull/7/head
yann300 8 years ago
parent b8bcfeffad
commit 791f1182cd
  1. 9
      src/ui/StepManager.js

@ -64,8 +64,13 @@ function StepManager (_parent, _traceManager) {
StepManager.prototype.resolveToReducedTrace = function (value, incr) { StepManager.prototype.resolveToReducedTrace = function (value, incr) {
if (this.parent.callTree.reducedTrace.length) { if (this.parent.callTree.reducedTrace.length) {
var nextSource = utils.findLowerClosestBound(value, this.parent.callTree.reducedTrace) var nextSource = utils.findClosestIndex(value, this.parent.callTree.reducedTrace)
nextSource = nextSource < this.parent.callTree.reducedTrace.length - 1 ? nextSource + incr : nextSource 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 this.parent.callTree.reducedTrace[nextSource]
} }
return value return value

Loading…
Cancel
Save