diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:37:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-26 15:37:24 +0200 |
commit | f9bd2d2aca0007bea80c9968657914a4dd3cff9a (patch) | |
tree | fbb453bfc76b40ede158f7c259fabfe6ae9e7008 | |
parent | 3981b5f5e0f191961f01699fab7c50533c48d352 (diff) |
ab
-rw-r--r-- | test/hole.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/test/hole.cpp b/test/hole.cpp index 2e2acc32..aecd121a 100644 --- a/test/hole.cpp +++ b/test/hole.cpp @@ -6,15 +6,16 @@ namespace { using bbox = cut_rectangle_result::bbox; +constexpr auto cutʹ(bbox rect, bbox hole, Vector2i offset) +{ + auto rectʹ = bbox { rect.position + offset, rect.bbox_size }; + auto holeʹ = bbox { hole.position + offset, hole.bbox_size }; + return cut_rectangle(rectʹ, holeʹ).size; +} + void test1(Vector2i offset) { constexpr auto rect = bbox{{}, {50, 50}}; - - constexpr auto cutʹ = [](bbox rect, bbox hole, Vector2i offset) { - auto rectʹ = bbox { rect.position + offset, rect.bbox_size }; - auto holeʹ = bbox { hole.position + offset, hole.bbox_size }; - return cut_rectangle(rectʹ, holeʹ).size; - }; #if 1 fm_assert_not_equal(0, cutʹ(rect, {{ 49, 0}, {50, 50}}, offset)); fm_assert_not_equal(0, cutʹ(rect, {{ 0, 49}, {50, 50}}, offset)); |