Skip to content

Commit

Permalink
Add a test on shape bounds when miter limit is reached
Browse files Browse the repository at this point in the history
  • Loading branch information
kimci86 committed Nov 6, 2023
1 parent 05cd5d8 commit 72427c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/Graphics/Shape.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,13 @@ TEST_CASE("[Graphics] sf::Shape", runDisplayTests())
CHECK(triangleShape.getLocalBounds() == Approx(sf::FloatRect({-7.2150f, -14.2400f}, {44.4300f, 59.2400f})));
CHECK(triangleShape.getGlobalBounds() == Approx(sf::FloatRect({-7.2150f, -14.2400f}, {44.4300f, 59.2400f})));
}

SECTION("Add beveled outline")
{
triangleShape.setMiterLimit(2);
triangleShape.setOutlineThickness(5);
CHECK(triangleShape.getLocalBounds() == Approx(sf::FloatRect({-7.2150f, -10.f}, {44.4300f, 55.f})));
CHECK(triangleShape.getGlobalBounds() == Approx(sf::FloatRect({-7.2150f, -10.f}, {44.4300f, 55.f})));
}
}
}

0 comments on commit 72427c0

Please sign in to comment.