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