summaryrefslogtreecommitdiff
path: root/src/geom/transform.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-05-03 11:40:27 +0200
committerMartin Haug <mhaug@live.de>2022-05-03 12:59:41 +0200
commit6a8a0ec6ec8bb8cf346ee0dd2c45ddcfbee7fbe6 (patch)
tree0d8716d2fa0c01a2319bb84be0283253bc6490fe /src/geom/transform.rs
parent33213abe7dfcb8d8065faadd2f5b72ec4b718af1 (diff)
Code Review: Heap is Stack. Unsafe is Good.
Spaghetti Code is Style.
Diffstat (limited to 'src/geom/transform.rs')
-rw-r--r--src/geom/transform.rs18
1 files changed, 2 insertions, 16 deletions
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.