summaryrefslogtreecommitdiffstats
path: root/src/common/math_util.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-08-16 07:47:54 +0200
committerGitHub <noreply@github.com>2020-08-16 07:47:54 +0200
commitdb96034ea429cf0b0b5e2bac790392d9e2f50990 (patch)
tree9a1ed0bfc2d01d67d0f62383dbb2a1f4c9fb4eca /src/common/math_util.h
parentMerge pull request #4519 from lioncash/semi (diff)
parentcommon/compression: Roll back std::span changes (diff)
downloadyuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.gz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.bz2
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.lz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.xz
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.tar.zst
yuzu-db96034ea429cf0b0b5e2bac790392d9e2f50990.zip
Diffstat (limited to 'src/common/math_util.h')
-rw-r--r--src/common/math_util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/math_util.h b/src/common/math_util.h
index abca3177c..cc35c90ee 100644
--- a/src/common/math_util.h
+++ b/src/common/math_util.h
@@ -23,7 +23,7 @@ struct Rectangle {
constexpr Rectangle(T left, T top, T right, T bottom)
: left(left), top(top), right(right), bottom(bottom) {}
- T GetWidth() const {
+ [[nodiscard]] T GetWidth() const {
if constexpr (std::is_floating_point_v<T>) {
return std::abs(right - left);
} else {
@@ -31,7 +31,7 @@ struct Rectangle {
}
}
- T GetHeight() const {
+ [[nodiscard]] T GetHeight() const {
if constexpr (std::is_floating_point_v<T>) {
return std::abs(bottom - top);
} else {
@@ -39,15 +39,15 @@ struct Rectangle {
}
}
- Rectangle<T> TranslateX(const T x) const {
+ [[nodiscard]] Rectangle<T> TranslateX(const T x) const {
return Rectangle{left + x, top, right + x, bottom};
}
- Rectangle<T> TranslateY(const T y) const {
+ [[nodiscard]] Rectangle<T> TranslateY(const T y) const {
return Rectangle{left, top + y, right, bottom + y};
}
- Rectangle<T> Scale(const float s) const {
+ [[nodiscard]] Rectangle<T> Scale(const float s) const {
return Rectangle{left, top, static_cast<T>(left + GetWidth() * s),
static_cast<T>(top + GetHeight() * s)};
}