Exemplo n.º 1
0
 public void testTransform()
 {
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.UNITY_MATRIX)).getUpperLeft().getX(), testRect.getUpperLeft().getX(), 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.UNITY_MATRIX)).getUpperLeft().getY(), testRect.getUpperLeft().getY(), 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.UNITY_MATRIX)).getLowerRight().getX(), testRect.getLowerRight().getX(), 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.UNITY_MATRIX)).getLowerRight().getY(), testRect.getLowerRight().getY(), 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.translate(3.0d, 5.0d))).getUpperLeft().getX(), 6.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.translate(3.0d, 5.0d))).getUpperLeft().getY(), 13.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.translate(3.0d, 5.0d))).getLowerRight().getX(), 8.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.translate(3.0d, 5.0d))).getLowerRight().getY(), 9.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.scale(2.0d, 4.0d))).getUpperLeft().getX(), 6.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.scale(2.0d, 4.0d))).getUpperLeft().getY(), 32.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.scale(2.0d, 4.0d))).getLowerRight().getX(), 10.0d, 0.000005d);
     Assert.AreEqual(((Rect2D)testRect.transform(TransformMatrix2D.scale(2.0d, 4.0d))).getLowerRight().getY(), 16.0d, 0.000005d);
 }