Round the rectangle size to prevent float to int casting issues

And other minor style changes
This commit is contained in:
James Rowe 2016-11-10 00:36:07 -07:00
parent 72786d410e
commit 48d64ccad5
3 changed files with 9 additions and 8 deletions

View file

@ -45,8 +45,8 @@ struct Rectangle {
return Rectangle{left, top + y, right, bottom + y};
}
Rectangle<T> Scale(const float s) const {
return Rectangle{left, top, static_cast<T>((right + left) * s),
static_cast<T>((top + bottom) * s)};
return Rectangle{left, top, static_cast<T>(left + GetWidth() * s),
static_cast<T>(top + GetHeight() * s)};
}
};