Skip to main content

canvas_transform

Function canvas_transform 

Source
pub fn canvas_transform(a: f32, b: f32, c: f32, d: f32, tx: f32, ty: f32)
Expand description

Apply a 2D affine transformation to subsequent draw commands.

The six values represent a column-major 3×2 matrix:

| a  c  tx |
| b  d  ty |
| 0  0   1 |

For a simple translation, use canvas_transform(1.0, 0.0, 0.0, 1.0, tx, ty).