From 6a8a0ec6ec8bb8cf346ee0dd2c45ddcfbee7fbe6 Mon Sep 17 00:00:00 2001 From: Martin Haug Date: Tue, 3 May 2022 11:40:27 +0200 Subject: Code Review: Heap is Stack. Unsafe is Good. Spaghetti Code is Style. --- src/geom/transform.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/geom/transform.rs') diff --git a/src/geom/transform.rs b/src/geom/transform.rs index de2a9781..961ba487 100644 --- a/src/geom/transform.rs +++ b/src/geom/transform.rs @@ -26,26 +26,12 @@ impl Transform { /// Transform by mirroring along the x-axis. pub fn mirror_x() -> Self { - Self { - sx: Ratio::one(), - ky: Ratio::zero(), - kx: Ratio::zero(), - sy: -Ratio::one(), - tx: Length::zero(), - ty: Length::zero(), - } + Self::scale(Ratio::one(), -Ratio::one()) } /// Transform by mirroring along the y-axis. pub fn mirror_y() -> Self { - Self { - sx: -Ratio::one(), - ky: Ratio::zero(), - kx: Ratio::zero(), - sy: Ratio::one(), - tx: Length::zero(), - ty: Length::zero(), - } + Self::scale(-Ratio::one(), Ratio::one()) } /// A translate transform. -- cgit v1.2.3