Commit 45f0757d authored by olau@iola.dk's avatar olau@iola.dk

Fixed two corner-case bugs when drawing filled curves

git-svn-id: https://flot.googlecode.com/svn/trunk@96 1e0a6537-2640-0410-bfb7-f154510ff394
parent 230b7464
Flot 0.x
--------
Fixed two corner-case bugs when drawing filled curves (report and
analysis by Joshua Varner).
Flot 0.5 Flot 0.5
-------- --------
......
...@@ -1180,11 +1180,13 @@ ...@@ -1180,11 +1180,13 @@
if (y1 >= axisy.max && y2 >= axisy.max) { if (y1 >= axisy.max && y2 >= axisy.max) {
ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max)); ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max)); ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
lastX = x2;
continue; continue;
} }
else if (y1 <= axisy.min && y2 <= axisy.min) { else if (y1 <= axisy.min && y2 <= axisy.min) {
ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min)); ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min)); ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
lastX = x2;
continue; continue;
} }
...@@ -1239,8 +1241,8 @@ ...@@ -1239,8 +1241,8 @@
else else
top = axisy.max; top = axisy.max;
ctx.lineTo(axisx.p2c(x2old), axisy.p2c(top));
ctx.lineTo(axisx.p2c(x2), axisy.p2c(top)); ctx.lineTo(axisx.p2c(x2), axisy.p2c(top));
ctx.lineTo(axisx.p2c(x2old), axisy.p2c(top));
} }
lastX = Math.max(x2, x2old); lastX = Math.max(x2, x2old);
......
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