gh-EmergeTools-Pow/Sources/Pow/Extensions/CGAffineTransform+Shear.swift
Joe Fabisevich 5b95fe95b0
Moving Pow to @emergetools (#36)
Co-authored-by: Robert Böhnke <robb@robb.is>
Co-authored-by: Kasper Lahti <kasper@lahti.email>
2023-11-29 12:08:53 -03:00

13 lines
326 B
Swift

import CoreGraphics
extension CGAffineTransform {
init(shearX x: CGFloat, y: CGFloat) {
self = .identity
self.c = x
self.b = y
}
}
func CGAffineTransformShear(_ t: CGAffineTransform, _ x: CGFloat, _ y: CGFloat) -> CGAffineTransform {
t.concatenating(CGAffineTransform(shearX: x, y: y))
}