Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

plotLineArea: fill path as one #65

Open
wants to merge 3 commits into from

1 participant

@risicle

I suppose this is more a rhetorical patch than anything.

Is there a reason plotLineArea() isn't done like so? Doing it like this allows me pull off a majorly useful hack in some of my other patches and follows the same way plotLine() does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 2 deletions.
  1. +4 −2 jquery.flot.js
View
6 jquery.flot.js
@@ -1719,6 +1719,7 @@
i = 0, top, areaOpen = false,
ypos = 1, segmentStart = 0, segmentEnd = 0;
+ ctx.beginPath();
// we process each segment in two turns, first forward
// direction to sketch out top, then once we hit the
// end we go backwards to sketch the bottom
@@ -1743,7 +1744,6 @@
if (ps < 0 && i == segmentStart + ps) {
// done with the reverse sweep
- ctx.fill();
areaOpen = false;
ps = -ps;
ypos = 1;
@@ -1787,7 +1787,6 @@
if (!areaOpen) {
// open area
- ctx.beginPath();
ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));
areaOpen = true;
}
@@ -1852,6 +1851,9 @@
ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));
}
}
+
+ // do the actual fill
+ ctx.fill ();
}
ctx.save();
Something went wrong with that request. Please try again.