Skip to content

Commit 3a31d34

Browse files
committed
[AffineTransform] Fix size transformation.
1 parent 127f75f commit 3a31d34

File tree

2 files changed

+168
-113
lines changed

2 files changed

+168
-113
lines changed

Sources/Foundation/AffineTransform.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,10 @@ extension AffineTransform {
268268

269269
/// Applies the transform to the specified size and returns the result.
270270
public func transform(_ size: CGSize) -> CGSize {
271-
let newVector = transform(CGPoint(x: size.width, y: size.height))
272-
273-
return CGSize(width: newVector.x, height: newVector.y)
271+
CGSize(
272+
width : (m11 * size.width) + (m21 * size.height),
273+
height: (m12 * size.width) + (m22 * size.height)
274+
)
274275
}
275276
}
276277

0 commit comments

Comments
 (0)