Commit 1d8cb8b3 authored by olau@iola.dk's avatar olau@iola.dk

Fixed bug in line calculation with small values of shadow size and

line width, reported by lepianiste (issue 179)


git-svn-id: https://flot.googlecode.com/svn/trunk@172 1e0a6537-2640-0410-bfb7-f154510ff394
parent aee8f05c
...@@ -1439,10 +1439,11 @@ ...@@ -1439,10 +1439,11 @@
// draw shadow as a thick and thin line with transparency // draw shadow as a thick and thin line with transparency
ctx.lineWidth = sw; ctx.lineWidth = sw;
ctx.strokeStyle = "rgba(0,0,0,0.1)"; ctx.strokeStyle = "rgba(0,0,0,0.1)";
var xoffset = 1; // position shadow at angle from the mid of line
plotLine(series.datapoints, xoffset, Math.sqrt((lw/2 + sw/2)*(lw/2 + sw/2) - xoffset*xoffset), series.xaxis, series.yaxis); var angle = Math.PI/18;
plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);
ctx.lineWidth = sw/2; ctx.lineWidth = sw/2;
plotLine(series.datapoints, xoffset, Math.sqrt((lw/2 + sw/4)*(lw/2 + sw/4) - xoffset*xoffset), series.xaxis, series.yaxis); plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);
} }
ctx.lineWidth = lw; ctx.lineWidth = lw;
......
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