From db716b3bdf039b38fe7dcb17776cae7803d47d24 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 5 Nov 2019 05:26:20 +0100 Subject: Apply HiDPI to text, images, and clip primitives Quads are a bit trickier to handle. We may need to change the shaders a bit. --- wgpu/src/transformation.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'wgpu/src/transformation.rs') 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 { -- cgit