Sitelet https://github.com/C4Labs/C4iOS/commit/cd6704ecf39a8ed90e9fcaa38c8e561ab77c5e8a
Skip to content

Commit cd6704e

Browse files
-- C4 --alejandro-isaza
authored andcommitted
Properly extracts tx and ty from transform (#693)
The previous addresses were incorrect. For example, a translation of `-100,-100` was returning an affine transform with `0` for `tx` and `ty`. The index values were backwards.
1 parent c40836e commit cd6704e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎C4/Core/Transform.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ public struct Transform: Equatable {
205205
b: CGFloat(self[0, 1]),
206206
c: CGFloat(self[1, 0]),
207207
d: CGFloat(self[1, 1]),
208-
tx: CGFloat(self[0, 3]),
209-
ty: CGFloat(self[1, 3]))
208+
tx: CGFloat(self[3, 0]),
209+
ty: CGFloat(self[3, 1]))
210210
}
211211

212212
/// The CATransform3D version of the receiver.

0 commit comments

Comments
 (0)