Commit e2b9cf8c authored by David Schnur's avatar David Schnur

Remove the unused offset parameter.

The drawBar method was always called with an offset of zero, and I see
no other way in which it is currently used. Resolves #382.
parent a286f044
...@@ -2469,7 +2469,7 @@ Licensed under the MIT license. ...@@ -2469,7 +2469,7 @@ Licensed under the MIT license.
ctx.restore(); ctx.restore();
} }
function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) { function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
var left, right, bottom, top, var left, right, bottom, top,
drawLeft, drawRight, drawTop, drawBottom, drawLeft, drawRight, drawTop, drawBottom,
tmp; tmp;
...@@ -2553,35 +2553,35 @@ Licensed under the MIT license. ...@@ -2553,35 +2553,35 @@ Licensed under the MIT license.
c.beginPath(); c.beginPath();
// FIXME: inline moveTo is buggy with excanvas // FIXME: inline moveTo is buggy with excanvas
c.moveTo(left, bottom + offset); c.moveTo(left, bottom);
if (drawLeft) if (drawLeft)
c.lineTo(left, top + offset); c.lineTo(left, top);
else else
c.moveTo(left, top + offset); c.moveTo(left, top);
if (drawTop) if (drawTop)
c.lineTo(right, top + offset); c.lineTo(right, top);
else else
c.moveTo(right, top + offset); c.moveTo(right, top);
if (drawRight) if (drawRight)
c.lineTo(right, bottom + offset); c.lineTo(right, bottom);
else else
c.moveTo(right, bottom + offset); c.moveTo(right, bottom);
if (drawBottom) if (drawBottom)
c.lineTo(left, bottom + offset); c.lineTo(left, bottom);
else else
c.moveTo(left, bottom + offset); c.moveTo(left, bottom);
c.stroke(); c.stroke();
} }
} }
function drawSeriesBars(series) { function drawSeriesBars(series) {
function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) { function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {
var points = datapoints.points, ps = datapoints.pointsize; var points = datapoints.points, ps = datapoints.pointsize;
for (var i = 0; i < points.length; i += ps) { for (var i = 0; i < points.length; i += ps) {
if (points[i] == null) if (points[i] == null)
continue; continue;
drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth); drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);
} }
} }
...@@ -2606,7 +2606,7 @@ Licensed under the MIT license. ...@@ -2606,7 +2606,7 @@ Licensed under the MIT license.
} }
var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null; var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;
plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis); plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis);
ctx.restore(); ctx.restore();
} }
...@@ -3017,7 +3017,7 @@ Licensed under the MIT license. ...@@ -3017,7 +3017,7 @@ Licensed under the MIT license.
octx.strokeStyle = highlightColor; octx.strokeStyle = highlightColor;
drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth, drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,
0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth); function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);
} }
function getColorOrGradient(spec, bottom, top, defaultColor) { function getColorOrGradient(spec, bottom, top, defaultColor) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment