From 40f45d7b7e35dd4937abe6b5ce16b6256b4f1eeb Mon Sep 17 00:00:00 2001 From: shan Date: Thu, 29 Sep 2022 10:52:58 -0700 Subject: Adds linear gradient support to 2D meshes in the canvas widget. --- graphics/src/transformation.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'graphics/src/transformation.rs') diff --git a/graphics/src/transformation.rs b/graphics/src/transformation.rs index 2a19caed..03f453db 100644 --- a/graphics/src/transformation.rs +++ b/graphics/src/transformation.rs @@ -8,7 +8,7 @@ pub struct Transformation(Mat4); impl Transformation { /// Get the identity transformation. pub fn identity() -> Transformation { - Transformation(Mat4::identity()) + Transformation(Mat4::IDENTITY) } /// Creates an orthographic projection. @@ -51,3 +51,9 @@ impl From for [f32; 16] { *t.as_ref() } } + +impl Into for Transformation { + fn into(self) -> Mat4 { + self.0 + } +} \ No newline at end of file -- cgit