Skip to main content

affine_to_canvas_params

Function affine_to_canvas_params 

Source
pub fn affine_to_canvas_params(affine: Affine) -> [f64; 6]
Expand description

Decomposes a plotkit Affine transform into the six parameters expected by CanvasRenderingContext2d.setTransform(a, b, c, d, e, f).

The kurbo Affine stores its coefficients as [a, b, c, d, e, f] where the matrix is:

| a  c  e |
| b  d  f |
| 0  0  1 |

Canvas2D setTransform expects (a, b, c, d, e, f) with the same layout.