Skip to content

Commit

Permalink
Add stub for isInRangeSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
bgirard committed Sep 11, 2012
1 parent ff53f96 commit f816d46
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,18 +349,29 @@ HistogramView.prototype = {
ctx.clearRect(0, 0, this._widthSum, height);

var self = this;
this._histogramData.forEach(function plotStep(step) {
for (var i = 0; i < this._histogramData.length; i++) {
var step = this._histogramData[i];
var isSelected = self._isStepSelected(step, highlightedCallstack);
ctx.fillStyle = isSelected ? "green" : step.color;
var isInRangeSelector = self._isInRangeSelector(i);
if (isSelected) {
ctx.fillStyle = "green";
} else if (isInRangeSelector) {
ctx.fillStyle = "blue";
} else {
ctx.fillStyle = step.color;
}
var roundedHeight = Math.round(step.value * height);
ctx.fillRect(step.x, height - roundedHeight, step.width, roundedHeight);
});
}

this._finishedRendering = true;
},
highlightedCallstackChanged: function HistogramView_highlightedCallstackChanged(highlightedCallstack) {
this._render(highlightedCallstack);
},
_isInRangeSelector: function HistogramView_isInRangeSelector(index) {
return false;
},
_isStepSelected: function HistogramView__isStepSelected(step, highlightedCallstack) {
if ("marker" in step)
return false;
Expand Down

0 comments on commit f816d46

Please sign in to comment.