region: remove incorrect union accessors

the union accessors x,y,w,h were predicated on the dimension being 2.
for higher/lower dimensions this resulted in the incorrect variable
being returned.

rather than do something fancy with unions and coord storage type for
access to the underlying data we force the user to acknowledge the split
storage of point/extent.

unfortunately we have pretty shitty names for the components as a
result.
This commit is contained in:
Danny Robson 2016-10-25 19:59:53 +11:00
parent 249f8adfed
commit 77c7d87d60

View File

@ -40,16 +40,8 @@ namespace util {
static constexpr size_t dimension = S;
static constexpr size_t elements = extent_t::elements + point_t::elements;
union {
struct {
point_t p;
extent_t e;
};
struct {
T x, y;
T w, h;
};
};
point_t p;
extent_t e;
//---------------------------------------------------------------------
region () = default;