From eea3df558f3293ebedc7b88773e0706cdae23972 Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sun, 9 Feb 2020 09:19:56 +1100 Subject: Feature [feature-requests:#1340] Move and use Point functions to avoid casting. --- include/Platform.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/Platform.h b/include/Platform.h index 7a621c65e..cdaf65140 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -104,7 +104,7 @@ public: constexpr explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) noexcept : x(x_), y(y_) { } - static Point FromInts(int x_, int y_) noexcept { + static constexpr Point FromInts(int x_, int y_) noexcept { return Point(static_cast(x_), static_cast(y_)); } @@ -139,7 +139,7 @@ public: left(left_), top(top_), right(right_), bottom(bottom_) { } - static PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept { + static constexpr PRectangle FromInts(int left_, int top_, int right_, int bottom_) noexcept { return PRectangle(static_cast(left_), static_cast(top_), static_cast(right_), static_cast(bottom_)); } -- cgit v1.2.3