From: Evert Timberg Date: Sun, 12 Jun 2016 13:19:33 +0000 (-0400) Subject: Capping these to the chart bounds causes lines to bend during pan and zoom X-Git-Tag: v2.1.5~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2758%2Fhead;p=thirdparty%2FChart.js.git Capping these to the chart bounds causes lines to bend during pan and zoom --- diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index 7e8d8ae3e..a0138eed2 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -254,11 +254,10 @@ module.exports = function(Chart) { meta.dataset._model.tension ); - // Prevent the bezier going outside of the bounds of the graph - model.controlPointPreviousX = Math.max(Math.min(controlPoints.previous.x, area.right), area.left); - model.controlPointPreviousY = Math.max(Math.min(controlPoints.previous.y, area.bottom), area.top); - model.controlPointNextX = Math.max(Math.min(controlPoints.next.x, area.right), area.left); - model.controlPointNextY = Math.max(Math.min(controlPoints.next.y, area.bottom), area.top); + model.controlPointPreviousX = controlPoints.previous.x; + model.controlPointPreviousY = controlPoints.previous.y; + model.controlPointNextX = controlPoints.next.x; + model.controlPointNextY = controlPoints.next.y; } },