From 48d64ccad5c8383c4dd5e43ef005ac71e0aa3bb1 Mon Sep 17 00:00:00 2001 From: James Rowe Date: Thu, 10 Nov 2016 00:36:07 -0700 Subject: Round the rectangle size to prevent float to int casting issues And other minor style changes --- src/common/math_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/math_util.h') diff --git a/src/common/math_util.h b/src/common/math_util.h index 9e630d93df..cdeaeb7333 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -45,8 +45,8 @@ struct Rectangle { return Rectangle{left, top + y, right, bottom + y}; } Rectangle Scale(const float s) const { - return Rectangle{left, top, static_cast((right + left) * s), - static_cast((top + bottom) * s)}; + return Rectangle{left, top, static_cast(left + GetWidth() * s), + static_cast(top + GetHeight() * s)}; } }; -- cgit v1.2.3