diff --git a/test/testPaint.cpp b/test/testPaint.cpp index c938124a..4d33be87 100644 --- a/test/testPaint.cpp +++ b/test/testPaint.cpp @@ -126,21 +126,34 @@ TEST_CASE("Bounding Box", "[tvgPaint]") //Case 1 REQUIRE(shape->appendRect(0.0f, 10.0f, 20.0f, 100.0f, 50.0f, 50.0f) == Result::Success); + REQUIRE(shape->translate(100.0f, 111.0f) == Result::Success); REQUIRE(shape->bounds(&x, &y, &w, &h, false) == Result::Success); REQUIRE(x == 0.0f); REQUIRE(y == 10.0f); REQUIRE(w == 20.0f); REQUIRE(h == 100.0f); + REQUIRE(shape->bounds(&x, &y, &w, &h, true) == Result::Success); + REQUIRE(x == 100.0f); + REQUIRE(y == 121.0f); + REQUIRE(w == 20.0f); + REQUIRE(h == 100.0f); //Case 2 REQUIRE(shape->reset() == Result::Success); REQUIRE(shape->moveTo(0.0f, 10.0f) == Result::Success); REQUIRE(shape->lineTo(20.0f, 210.0f) == Result::Success); + auto identity = Matrix{1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f}; + REQUIRE(shape->transform(identity) == Result::Success); REQUIRE(shape->bounds(&x, &y, &w, &h, false) == Result::Success); REQUIRE(x == 0.0f); REQUIRE(y == 10.0f); REQUIRE(w == 20.0f); REQUIRE(h == 200.0f); + REQUIRE(shape->bounds(&x, &y, &w, &h, true) == Result::Success); + REQUIRE(x == 0.0f); + REQUIRE(y == 10.0f); + REQUIRE(w == 20.0f); + REQUIRE(h == 200.0f); } TEST_CASE("Duplication", "[tvgPaint]")