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. --- win32/PlatWin.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'win32/PlatWin.h') diff --git a/win32/PlatWin.h b/win32/PlatWin.h index 6fb8ff5f1..001a834cc 100644 --- a/win32/PlatWin.h +++ b/win32/PlatWin.h @@ -19,6 +19,14 @@ constexpr RECT RectFromPRectangle(PRectangle prc) noexcept { return rc; } +constexpr POINT POINTFromPoint(Point pt) noexcept { + return POINT{ static_cast(pt.x), static_cast(pt.y) }; +} + +constexpr Point PointFromPOINT(POINT pt) noexcept { + return Point::FromInts(pt.x, pt.y); +} + constexpr HWND HwndFromWindowID(WindowID wid) noexcept { return static_cast(wid); } -- cgit v1.2.3