summaryrefslogtreecommitdiffhomepage
path: root/src/hole.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/hole.cpp')
-rw-r--r--src/hole.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/hole.cpp b/src/hole.cpp
index aba4e7f3..5551b780 100644
--- a/src/hole.cpp
+++ b/src/hole.cpp
@@ -112,12 +112,10 @@ constexpr element make_element(uint8_t s)
}
fm_assert(false);
}
-constexpr auto elements = map(make_element, iota_array<uint8_t, 16>);
-static_assert(array_size(elements) == 16);
-} // namespace
+constexpr auto elements = map(make_element, iota_array<uint8_t, 16>);
-constexpr cut_rectangle_result cut_rectangle(bbox input, bbox hole)
+constexpr cut_rectangle_result cut_rectangleʹ(bbox input, bbox hole)
{
auto ihalf = Vector2i{input.bbox_size/2};
auto r0 = input.position - ihalf;
@@ -167,10 +165,14 @@ constexpr cut_rectangle_result cut_rectangle(bbox input, bbox hole)
res.array[i] = { {x0, y0}, {x1, y1}, };
}
- fm_assert(false);
- std::unreachable();
+ return res;
+}
+
+} // namespace
- //return -1;
+cut_rectangle_result cut_rectangle(bbox input, bbox hole)
+{
+ return cut_rectangleʹ(input, hole);
}
} // namespace floormat