From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/common/math_util.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/common/math_util.h') diff --git a/src/common/math_util.h b/src/common/math_util.h index d44b06e74..696bd43ea 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -8,33 +8,38 @@ #include #include -namespace MathUtil -{ +namespace MathUtil { -inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, unsigned length1) { +inline bool IntervalsIntersect(unsigned start0, unsigned length0, unsigned start1, + unsigned length1) { return (std::max(start0, start1) < std::min(start0 + length0, start1 + length1)); } -template -inline T Clamp(const T val, const T& min, const T& max) -{ +template +inline T Clamp(const T val, const T& min, const T& max) { return std::max(min, std::min(max, val)); } -template -struct Rectangle -{ +template +struct Rectangle { T left; T top; T right; T bottom; - Rectangle() {} + Rectangle() { + } - Rectangle(T left, T top, T right, T bottom) : left(left), top(top), right(right), bottom(bottom) {} + Rectangle(T left, T top, T right, T bottom) + : left(left), top(top), right(right), bottom(bottom) { + } - T GetWidth() const { return std::abs(static_cast::type>(right - left)); } - T GetHeight() const { return std::abs(static_cast::type>(bottom - top)); } + T GetWidth() const { + return std::abs(static_cast::type>(right - left)); + } + T GetHeight() const { + return std::abs(static_cast::type>(bottom - top)); + } }; -} // namespace MathUtil +} // namespace MathUtil -- cgit v1.2.3