Clean up UI type static_casts.

So disgusting, but not entirely gone yet...
This commit is contained in:
Jared Boone 2016-01-23 17:02:16 -08:00
parent 60b8b38652
commit ce481c0b5a
9 changed files with 45 additions and 62 deletions

View file

@ -36,9 +36,7 @@ Rect Rect::intersect(const Rect& o) const {
const auto y1 = std::max(top(), o.top());
const auto y2 = std::min(bottom(), o.bottom());
if( (x2 >= x1) && (y2 > y1) ) {
return {
x1, y1,
static_cast<Dim>(x2 - x1), static_cast<Dim>(y2 - y1) };
return { x1, y1, x2 - x1, y2 - y1 };
} else {
return { };
}
@ -54,7 +52,7 @@ Rect& Rect::operator+=(const Rect& p) {
pos = { x1, y1 };
const auto x2 = std::max(right(), p.right());
const auto y2 = std::max(bottom(), p.bottom());
size = { static_cast<Dim>(x2 - x1), static_cast<Dim>(y2 - y1) };
size = { x2 - x1, y2 - y1 };
}
return *this;
}