@@ -59,41 +59,14 @@ function getLineMethod(line) {
5959 : helpers . canvas . _bezierCurveTo ;
6060}
6161
62- function pointInLine ( p1 , p2 , t ) {
63- return {
64- x : p1 . x + t * ( p2 . x - p1 . x ) ,
65- y : p1 . y + t * ( p2 . y - p1 . y )
66- } ;
67- }
68-
69- function steppeInterpolation ( p1 , p2 , t , mode ) {
70- return {
71- x : p1 . x + t * ( p2 . x - p1 . x ) ,
72- y : mode === 'middle' ? t < 0.5 ? p1 . y : p2 . y
73- : mode === 'after' ? t < 1 ? p1 . y : p2 . y
74- : t > 0 ? p2 . y : p1 . y
75- } ;
76- }
77-
78- function bezierInterpolation ( p1 , p2 , t ) {
79- const cp1 = { x : p1 . controlPointNextX , y : p1 . controlPointNextY } ;
80- const cp2 = { x : p2 . controlPointPreviousX , y : p2 . controlPointPreviousY } ;
81- const a = pointInLine ( p1 , cp1 , t ) ;
82- const b = pointInLine ( cp1 , cp2 , t ) ;
83- const c = pointInLine ( cp2 , p2 , t ) ;
84- const d = pointInLine ( a , b , t ) ;
85- const e = pointInLine ( b , c , t ) ;
86- return pointInLine ( d , e , t ) ;
87- }
88-
8962function getInterpolationMethod ( line ) {
9063 if ( line . steppedLine ) {
91- return steppeInterpolation ;
64+ return helpers . math . steppeInterpolation ;
9265 }
9366 if ( ! line . tension ) {
94- return pointInLine ;
67+ return helpers . math . pointInLine ;
9568 }
96- return bezierInterpolation ;
69+ return helpers . math . bezierInterpolation ;
9770}
9871
9972function lineEnd ( points , bounds ) {
0 commit comments