Commit 49c312c3 authored by David Schnur's avatar David Schnur

Fix lines incorrectly broken before an operator.

parent b8905be5
...@@ -1191,10 +1191,10 @@ Licensed under the MIT license. ...@@ -1191,10 +1191,10 @@ Licensed under the MIT license.
// a little bit of line specific stuff that // a little bit of line specific stuff that
// perhaps shouldn't be here, but lacking // perhaps shouldn't be here, but lacking
// better means... // better means...
if (insertSteps && k > 0 if (insertSteps && k > 0 &&
&& points[k - ps] != null points[k - ps] != null &&
&& points[k - ps] != points[k] points[k - ps] != points[k] &&
&& points[k - ps + 1] != points[k + 1]) { points[k - ps + 1] != points[k + 1]) {
// copy the point to make room for a middle point // copy the point to make room for a middle point
for (m = 0; m < ps; ++m) { for (m = 0; m < ps; ++m) {
points[k + ps + m] = points[k + m]; points[k + ps + m] = points[k + m];
...@@ -2084,11 +2084,11 @@ Licensed under the MIT license. ...@@ -2084,11 +2084,11 @@ Licensed under the MIT license.
xoff = yoff = 0; xoff = yoff = 0;
if (isNaN(v) || v < axis.min || v > axis.max if (isNaN(v) || v < axis.min || v > axis.max || (
// skip those lying on the axes if we got a border // skip those lying on the axes if we got a border
|| (t == "full" t == "full" && ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) &&
&& ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) (v == axis.min || v == axis.max)
&& (v == axis.min || v == axis.max))) { )) {
continue; continue;
} }
...@@ -2997,10 +2997,11 @@ Licensed under the MIT license. ...@@ -2997,10 +2997,11 @@ Licensed under the MIT license.
// clear auto-highlights // clear auto-highlights
for (var i = 0; i < highlights.length; ++i) { for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i]; var h = highlights[i];
if (h.auto == eventname && if (h.auto == eventname && !(
!(item && h.series == item.series && item && h.series == item.series &&
h.point[0] == item.datapoint[0] && h.point[0] == item.datapoint[0] &&
h.point[1] == item.datapoint[1])) { h.point[1] == item.datapoint[1]
)) {
unhighlight(h.series, h.point); unhighlight(h.series, h.point);
} }
} }
...@@ -3061,7 +3062,6 @@ Licensed under the MIT license. ...@@ -3061,7 +3062,6 @@ Licensed under the MIT license.
var i = indexOfHighlight(s, point); var i = indexOfHighlight(s, point);
if (i == -1) { if (i == -1) {
highlights.push({ series: s, point: point, auto: auto }); highlights.push({ series: s, point: point, auto: auto });
triggerRedrawOverlay(); triggerRedrawOverlay();
} else if (!auto) { } else if (!auto) {
highlights[i].auto = false; highlights[i].auto = false;
...@@ -3087,7 +3087,6 @@ Licensed under the MIT license. ...@@ -3087,7 +3087,6 @@ Licensed under the MIT license.
var i = indexOfHighlight(s, point); var i = indexOfHighlight(s, point);
if (i != -1) { if (i != -1) {
highlights.splice(i, 1); highlights.splice(i, 1);
triggerRedrawOverlay(); triggerRedrawOverlay();
} }
} }
...@@ -3095,8 +3094,7 @@ Licensed under the MIT license. ...@@ -3095,8 +3094,7 @@ Licensed under the MIT license.
function indexOfHighlight(s, p) { function indexOfHighlight(s, p) {
for (var i = 0; i < highlights.length; ++i) { for (var i = 0; i < highlights.length; ++i) {
var h = highlights[i]; var h = highlights[i];
if (h.series == s && h.point[0] == p[0] if (h.series === s && h.point[0] === p[0] && h.point[1] === p[1]) {
&& h.point[1] == p[1]) {
return i; return i;
} }
} }
......
...@@ -564,9 +564,10 @@ More detail and specific examples can be found in the included HTML file. ...@@ -564,9 +564,10 @@ More detail and specific examples can be found in the included HTML file.
function isPointInPoly(poly, pt) { function isPointInPoly(poly, pt) {
for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) { for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1])) ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) ||
&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) (poly[j][1] <= pt[1] && pt[1]< poly[i][1])) &&
&& (c = !c); (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) &&
(c = !c);
} }
return c; return c;
} }
......
...@@ -176,10 +176,10 @@ charts or filled areas). ...@@ -176,10 +176,10 @@ charts or filled areas).
} }
// maintain the line steps invariant // maintain the line steps invariant
if (withsteps && l != newpoints.length && l > 0 if (withsteps && l != newpoints.length && l > 0 &&
&& newpoints[l] != null newpoints[l] != null &&
&& newpoints[l] != newpoints[l - ps] newpoints[l] != newpoints[l - ps] &&
&& newpoints[l + 1] != newpoints[l - ps + 1]) { newpoints[l + 1] != newpoints[l - ps + 1]) {
for (m = 0; m < ps; ++m) { for (m = 0; m < ps; ++m) {
newpoints[l + ps + m] = newpoints[l + m]; newpoints[l + ps + m] = newpoints[l + m];
} }
......
...@@ -77,8 +77,7 @@ You may need to check for this in hover events. ...@@ -77,8 +77,7 @@ You may need to check for this in hover events.
p = newpoints; p = newpoints;
} }
if (addCrossingPoints && prevp != p && x != null if (addCrossingPoints && prevp != p && x != null && i > 0 && origpoints[i - ps] != null) {
&& i > 0 && origpoints[i - ps] != null) {
var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]); var interx = x + (below - y) * (x - origpoints[i - ps]) / (y - origpoints[i - ps + 1]);
prevp.push(interx); prevp.push(interx);
prevp.push(below); prevp.push(below);
......
...@@ -224,9 +224,9 @@ API.txt for details. ...@@ -224,9 +224,9 @@ API.txt for details.
} }
for (var i = 0; i < spec.length - 1; ++i) { for (var i = 0; i < spec.length - 1; ++i) {
if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]] if (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]] +
+ spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2 &&
&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) { spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {
break; break;
} }
} }
...@@ -335,8 +335,7 @@ API.txt for details. ...@@ -335,8 +335,7 @@ API.txt for details.
d.setDate(1); d.setDate(1);
var start = d.getTime(); var start = d.getTime();
d.setMonth(d.getMonth() + d.setMonth(d.getMonth() + (unit == "quarter" ? 3 : 1));
(unit == "quarter" ? 3 : 1));
var end = d.getTime(); var end = d.getTime();
d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize); d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
carry = d.getHours(); carry = d.getHours();
...@@ -370,7 +369,7 @@ API.txt for details. ...@@ -370,7 +369,7 @@ API.txt for details.
var useQuarters = (axis.options.tickSize && var useQuarters = (axis.options.tickSize &&
axis.options.tickSize[1] == "quarter") || axis.options.tickSize[1] == "quarter") ||
(axis.options.minTickSize && (axis.options.minTickSize &&
axis.options.minTickSize[1] == "quarter"); axis.options.minTickSize[1] == "quarter");
var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]]; var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
......
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