From 6b1971ed196b7e1af0163f3c877b0dbe0b642c2e Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Mon, 8 Sep 2008 12:49:58 +0000 Subject: [PATCH] Fixed a bug with line widths of bars git-svn-id: https://flot.googlecode.com/svn/trunk@72 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 3 ++- jquery.flot.js | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 5ad9a42..4bab393 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -25,7 +25,8 @@ timothytoe). Fixed a bug in finding max values for all-negative data sets. Prevent the possibility of eternal looping in tick calculations. Fixed a bug when borderWidth is set to 0 (reported by Rob/sanchothefat). Fixed a bug with drawing bars extending below 0 -(reported by James Hewitt, convenient patch by Ryan Funduk). +(reported by James Hewitt, convenient patch by Ryan Funduk). Fixed a +bug with line widths of bars (reported by MikeM). Flot 0.4 diff --git a/jquery.flot.js b/jquery.flot.js index 44f84c3..a793513 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1274,10 +1274,10 @@ ctx.translate(plotOffset.left, plotOffset.top); ctx.lineJoin = "round"; - var bw = series.bars.barWidth; - var lw = Math.min(series.bars.lineWidth, bw); // FIXME: figure out a way to add shadows /* + var bw = series.bars.barWidth; + var lw = series.bars.lineWidth; var sw = series.shadowSize; if (sw > 0) { // draw shadow in two steps @@ -1290,10 +1290,10 @@ plotBars(series.data, bw, lw/2 + ctx.lineWidth/2, false); }*/ - ctx.lineWidth = lw; + ctx.lineWidth = series.bars.lineWidth; ctx.strokeStyle = series.color; setFillStyle(series.bars, series.color); - plotBars(series.data, bw, 0, series.bars.fill); + plotBars(series.data, series.bars.barWidth, 0, series.bars.fill); ctx.restore(); }