mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-24 09:21:33 -04:00
Clean up UI type static_casts.
So disgusting, but not entirely gone yet...
This commit is contained in:
parent
60b8b38652
commit
ce481c0b5a
9 changed files with 45 additions and 62 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue