|  | 
| 1 | 1 | //! All the things you need to handle bezier curves | 
| 2 | 2 | 
 | 
| 3 | 3 | use crate::{ | 
|  | 4 | +    BBox, EPSILON, EllipArc, LineCap, LineJoin, Point, Scalar, StrokeStyle, SvgParserError, | 
|  | 5 | +    SvgPathCmd, SvgPathParser, Transform, | 
| 4 | 6 |     utils::{ | 
| 5 |  | -        clamp, cubic_solve, integrate_quadrature, quadratic_solve, ArrayIter, M3x3, M4x4, | 
| 6 |  | -        QUADRATURE_16, QUADRATURE_32, | 
|  | 7 | +        ArrayIter, M3x3, M4x4, QUADRATURE_16, QUADRATURE_32, clamp, cubic_solve, | 
|  | 8 | +        integrate_quadrature, quadratic_solve, | 
| 7 | 9 |     }, | 
| 8 |  | -    BBox, EllipArc, LineCap, LineJoin, Point, Scalar, StrokeStyle, SvgParserError, SvgPathCmd, | 
| 9 |  | -    SvgPathParser, Transform, EPSILON, | 
| 10 | 10 | }; | 
| 11 | 11 | use std::{fmt, io::Cursor, str::FromStr}; | 
| 12 | 12 | 
 | 
| @@ -834,7 +834,14 @@ impl Curve for Cubic { | 
| 834 | 834 |     fn roots(&self) -> CurveRoots { | 
| 835 | 835 |         let mut result = CurveRoots::new(); | 
| 836 | 836 |         // curve(t)_y = 0 | 
| 837 |  | -        let Self([Point([_, y0]), Point([_, y1]), Point([_, y2]), Point([_, y3])]) = *self; | 
|  | 837 | +        let Self( | 
|  | 838 | +            [ | 
|  | 839 | +                Point([_, y0]), | 
|  | 840 | +                Point([_, y1]), | 
|  | 841 | +                Point([_, y2]), | 
|  | 842 | +                Point([_, y3]), | 
|  | 843 | +            ], | 
|  | 844 | +        ) = *self; | 
| 838 | 845 |         let a = -y0 + 3.0 * y1 - 3.0 * y2 + y3; | 
| 839 | 846 |         let b = 3.0 * y0 - 6.0 * y1 + 3.0 * y2; | 
| 840 | 847 |         let c = -3.0 * y0 + 3.0 * y1; | 
|  | 
0 commit comments