From: Evert Timberg Date: Fri, 27 May 2016 00:02:46 +0000 (-0400) Subject: Line points need always need to pivot after regardless of whether or not bezier point... X-Git-Tag: v2.1.5~35^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2649%2Fhead;p=thirdparty%2FChart.js.git Line points need always need to pivot after regardless of whether or not bezier points are updated. Bezier points should only be updated if the line tension is not 0. --- diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index 4c692d5ab..ef3f2b65d 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -32,11 +32,12 @@ module.exports = function(Chart) { addElementAndReset: function(index) { var me = this; var options = me.chart.options; + var meta = me.getMeta(); Chart.DatasetController.prototype.addElementAndReset.call(me, index); // Make sure bezier control points are updated - if (options.showLines && options.elements.line.tension !== 0) { + if (options.showLines && meta.dataset._model.tension !== 0) { me.updateBezierControlPoints(); } }, @@ -92,9 +93,14 @@ module.exports = function(Chart) { me.updateElement(points[i], i, reset); } - if (options.showLines && lineElementOptions.tension !== 0) { + if (options.showLines && line._model.tension !== 0) { me.updateBezierControlPoints(); } + + // Now pivot the point for animation + for (i=0, ilen=points.length; i