region: relax assertion to allow zero width/height

some degenerate cases create regions of zero area, but non-zero
dimensions. eg, vertical linear bezier curves.
This commit is contained in:
Danny Robson 2017-07-28 14:23:20 +10:00
parent 1f337ef964
commit 1248f15e4f

View File

@ -50,6 +50,11 @@ util::region<S,T>::region (point_t _a,
point_t _b): point_t _b):
region (_a, extent_t { _b - _a }) region (_a, extent_t { _b - _a })
{ {
// This check must allow for zero area (but non-zero dimension) regions.
// Some code paths need to support this degenerate case. It's ugly but
// simplifies generalisation. eg, vertical linear bezier curves.
CHECK (all (_a <= _b));
debug::sanity (*this); debug::sanity (*this);
} }