@@ -41,6 +41,7 @@ class TestAffineTransform : XCTestCase {
41
41
( " test_hashing_identity " , test_hashing_identity) ,
42
42
( " test_hashing_values " , test_hashing_values) ,
43
43
( " test_rotation_compose " , test_rotation_compose) ,
44
+ ( " test_translation_and_rotation " , test_translation_and_rotation) ,
44
45
( " test_Equal " , test_Equal) ,
45
46
( " test_NSCoding " , test_NSCoding) ,
46
47
]
@@ -358,7 +359,14 @@ class TestAffineTransform : XCTestCase {
358
359
XCTAssertEqual ( 0.0 , Double ( result. x) , accuracy: accuracyThreshold)
359
360
XCTAssertEqual ( 1.0 , Double ( result. y) , accuracy: accuracyThreshold)
360
361
}
361
-
362
+
363
+ func test_translation_and_rotation( ) {
364
+ let point = NSPoint ( x: CGFloat ( 10 ) , y: CGFloat ( 10 ) )
365
+ var translateThenRotate = AffineTransform ( translationByX: 20 , byY: - 30 )
366
+ translateThenRotate. rotate ( byRadians: . pi / 2 )
367
+ checkPointTransformation ( NSAffineTransform ( transform: translateThenRotate) , point: point, expectedPoint: NSPoint ( x: CGFloat ( 10 ) , y: CGFloat ( - 20 ) ) )
368
+ }
369
+
362
370
func test_Equal( ) {
363
371
let transform = NSAffineTransform ( )
364
372
let transform1 = NSAffineTransform ( )
0 commit comments