diff options
author | Levi <L3ehunin@gmail.com> | 2021-01-11 06:09:56 +0100 |
---|---|---|
committer | Levi <L3ehunin@gmail.com> | 2021-01-11 06:09:56 +0100 |
commit | 7a3c884e39fccfbb498b855080bffabc9ce2e7f1 (patch) | |
tree | 5056f9406dec188439cb0deb87603498243a9412 /src/common/math_util.h | |
parent | More forgetting... duh (diff) | |
parent | Merge pull request #5229 from Morph1984/fullscreen-opt (diff) | |
download | yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.gz yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.bz2 yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.lz yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.xz yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.tar.zst yuzu-7a3c884e39fccfbb498b855080bffabc9ce2e7f1.zip |
Diffstat (limited to 'src/common/math_util.h')
-rw-r--r-- | src/common/math_util.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h index b35ad8507..4c38d8040 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -20,14 +20,14 @@ struct Rectangle { constexpr Rectangle() = default; - constexpr Rectangle(T left, T top, T right, T bottom) - : left(left), top(top), right(right), bottom(bottom) {} + constexpr Rectangle(T left_, T top_, T right_, T bottom_) + : left(left_), top(top_), right(right_), bottom(bottom_) {} [[nodiscard]] T GetWidth() const { if constexpr (std::is_floating_point_v<T>) { return std::abs(right - left); } else { - return std::abs(static_cast<std::make_signed_t<T>>(right - left)); + return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(right - left))); } } @@ -35,7 +35,7 @@ struct Rectangle { if constexpr (std::is_floating_point_v<T>) { return std::abs(bottom - top); } else { - return std::abs(static_cast<std::make_signed_t<T>>(bottom - top)); + return static_cast<T>(std::abs(static_cast<std::make_signed_t<T>>(bottom - top))); } } |