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 From cb7c4676543cd508dfae8d4dcbd9cc8b61b1a94e Mon Sep 17 00:00:00 2001 From: shan Date: Thu, 6 Oct 2022 07:28:05 -0700 Subject: Fixed lint issues & cleaned up some documentation. --- graphics/src/transformation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/src/transformation.rs') diff --git a/graphics/src/transformation.rs b/graphics/src/transformation.rs index 03f453db..116b3058 100644 --- a/graphics/src/transformation.rs +++ b/graphics/src/transformation.rs @@ -56,4 +56,4 @@ impl Into for Transformation { fn into(self) -> Mat4 { self.0 } -} \ No newline at end of file +} -- cgit From 7e22e2d45293c5916812be03dc7367134b69b3ad Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 3 Nov 2022 04:53:27 +0100 Subject: Fix lints by `clippy` --- graphics/src/transformation.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'graphics/src/transformation.rs') diff --git a/graphics/src/transformation.rs b/graphics/src/transformation.rs index 116b3058..cf0457a4 100644 --- a/graphics/src/transformation.rs +++ b/graphics/src/transformation.rs @@ -52,8 +52,8 @@ impl From for [f32; 16] { } } -impl Into for Transformation { - fn into(self) -> Mat4 { - self.0 +impl From for Mat4 { + fn from(transformation: Transformation) -> Self { + transformation.0 } } -- cgit