diff options
author | 2019-11-05 05:26:20 +0100 | |
---|---|---|
committer | 2019-11-05 05:26:20 +0100 | |
commit | db716b3bdf039b38fe7dcb17776cae7803d47d24 (patch) | |
tree | 510f31387190d7e1b49e01610a651a39a9763106 /wgpu/src/transformation.rs | |
parent | 0157121038987feb6c2ea3066a21ce25e689888e (diff) | |
download | iced-db716b3bdf039b38fe7dcb17776cae7803d47d24.tar.gz iced-db716b3bdf039b38fe7dcb17776cae7803d47d24.tar.bz2 iced-db716b3bdf039b38fe7dcb17776cae7803d47d24.zip |
Apply HiDPI to text, images, and clip primitives
Quads are a bit trickier to handle. We may need to change the shaders a
bit.
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 { |