Skip to content

Commit bbc6b4c

Browse files
committed
src/hole: add unsigned integral value support
1 parent 8db5d92 commit bbc6b4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/hole-cut.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,13 @@ template<typename T> Cr<T> CutResult<T>::cutʹ(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h
213213
return cut_rectangleʹ<T>(r0, r1, h0, h1, s);
214214
}
215215

216-
template<typename T> Cr<T> CutResult<T>::cut(bbox input, bbox hole) { return cut_rectangle<T>(input, hole); }
216+
template<typename T> Cr<T> CutResult<T>::cut(bbox input, bbox hole) requires std::is_signed_v<T> { return cut_rectangle<T>(input, hole); }
217217
template<typename T> Cr<T> CutResult<T>::cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1) { return cut_rectangle<T>(r0, r1, h0, h1); }
218218

219219
template<typename T> bool CutResult<T>::found() const { return s != (uint8_t)-1; }
220220

221-
template struct CutResult<Int>;
221+
template struct CutResult<uint32_t>;
222+
template struct CutResult<int32_t>;
222223
template struct CutResult<float>;
223224

224225
} // namespace floormat

src/hole-cut.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct CutResult
1212
struct bbox { Vec2 position; Vector2ub bbox_size; };
1313
struct rect { Vec2 min, max; };
1414

15-
static CutResult cut(bbox input, bbox hole);
15+
static CutResult cut(bbox input, bbox hole) requires std::is_signed_v<T>;
1616
static CutResult cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1);
1717
static CutResult cutʹ(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1, uint8_t s);
1818

0 commit comments

Comments
 (0)