diff options
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/transformation.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wgpu/src/transformation.rs b/wgpu/src/transformation.rs index b0d14cc8..52165387 100644 --- a/wgpu/src/transformation.rs +++ b/wgpu/src/transformation.rs @@ -26,6 +26,11 @@ impl Transformation { pub fn translate(x: f32, y: f32) -> Transformation { Transformation(Mat4::from_translation(Vec3::new(x, y, 0.0))) } + + /// Creates a scale transformation. + pub fn scale(x: f32, y: f32) -> Transformation { + Transformation(Mat4::from_scale(Vec3::new(x, y, 0.0))) + } } impl Mul for Transformation { |