diff options
| author | 2016-11-10 00:36:07 -0700 | |
|---|---|---|
| committer | 2016-11-12 10:49:47 -0700 | |
| commit | 793339b73a9bc87d6fa22742be4631565c2201db (patch) | |
| tree | 5177fdef58d7cf99fded0d913072372a425cbe63 /src/common/math_util.h | |
| parent | Add default hotkey to swap primary screens. (diff) | |
| download | yuzu-793339b73a9bc87d6fa22742be4631565c2201db.tar.gz yuzu-793339b73a9bc87d6fa22742be4631565c2201db.tar.xz yuzu-793339b73a9bc87d6fa22742be4631565c2201db.zip | |
Round the rectangle size to prevent float to int casting issues
And other minor style changes
Diffstat (limited to '')
| -rw-r--r-- | src/common/math_util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h index 9e630d93d..cdeaeb733 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h | |||
| @@ -45,8 +45,8 @@ struct Rectangle { | |||
| 45 | return Rectangle{left, top + y, right, bottom + y}; | 45 | return Rectangle{left, top + y, right, bottom + y}; |
| 46 | } | 46 | } |
| 47 | Rectangle<T> Scale(const float s) const { | 47 | Rectangle<T> Scale(const float s) const { |
| 48 | return Rectangle{left, top, static_cast<T>((right + left) * s), | 48 | return Rectangle{left, top, static_cast<T>(left + GetWidth() * s), |
| 49 | static_cast<T>((top + bottom) * s)}; | 49 | static_cast<T>(top + GetHeight() * s)}; |
| 50 | } | 50 | } |
| 51 | }; | 51 | }; |
| 52 | 52 | ||