Skip to content

Commit 26a1b14

Browse files
committed
AffineTransform fixes
1 parent 918af4f commit 26a1b14

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/yup_graphics/yup_AffineTransform.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,17 +523,18 @@ TEST (AffineTransformTests, MultiplicationOperator)
523523
AffineTransform t2 = AffineTransform::translation (5.0f, 10.0f);
524524

525525
// operator* is equivalent to followedBy
526-
// t1 * t2 means: apply t2 first, then t1
526+
// t1 * t2 means: this * other = t1 * t2
527+
// This applies t2 first, then t1
527528
AffineTransform result = t1 * t2;
528529

529-
// This is equivalent to: scale then translate
530-
// Point (1, 1) -> translate (5, 10) -> (6, 11) -> scale (2) -> (12, 22)
530+
// This is: scale then translate
531+
// Point (1, 1) -> scale (2) -> (2, 2) -> translate (5, 10) -> (7, 12)
531532
Point<float> p (1.0f, 1.0f);
532533
float x = p.getX();
533534
float y = p.getY();
534535
result.transformPoint (x, y);
535-
EXPECT_FLOAT_EQ (x, 12.0f);
536-
EXPECT_FLOAT_EQ (y, 22.0f);
536+
EXPECT_FLOAT_EQ (x, 7.0f);
537+
EXPECT_FLOAT_EQ (y, 12.0f);
537538

538539
// Verify it's the same as followedBy
539540
AffineTransform result2 = t1.followedBy (t2);

0 commit comments

Comments
 (0)