summaryrefslogtreecommitdiff
path: root/src/geom/transform.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2022-04-30 21:59:34 +0200
committerMartin Haug <mhaug@live.de>2022-05-01 11:50:34 +0200
commit5f1499d380e223e7e1b2a8a96eb99e3ec95a56ac (patch)
tree44945bc35618c9ce10380016200309e42c2b5ed4 /src/geom/transform.rs
parentf9e115daf54c29358f890b137f50a33a781af680 (diff)
Add round corners and change arguments
Diffstat (limited to 'src/geom/transform.rs')
-rw-r--r--src/geom/transform.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/geom/transform.rs b/src/geom/transform.rs
index 28a1af80..de2a9781 100644
--- a/src/geom/transform.rs
+++ b/src/geom/transform.rs
@@ -24,6 +24,30 @@ 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(),
+ }
+ }
+
+ /// 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(),
+ }
+ }
+
/// A translate transform.
pub const fn translate(tx: Length, ty: Length) -> Self {
Self { tx, ty, ..Self::identity() }