aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.h
diff options
context:
space:
mode:
authorZufu Liu <unknown>2020-02-09 09:19:56 +1100
committerZufu Liu <unknown>2020-02-09 09:19:56 +1100
commiteea3df558f3293ebedc7b88773e0706cdae23972 (patch)
treeae7d41ffe130b0e1c1fb2b31071e0cfbf4f79282 /win32/PlatWin.h
parent7b35a02b461847b7d6260dc9e6a988651d8a290b (diff)
downloadscintilla-mirror-eea3df558f3293ebedc7b88773e0706cdae23972.tar.gz
Feature [feature-requests:#1340] Move and use Point functions to avoid casting.
Diffstat (limited to 'win32/PlatWin.h')
-rw-r--r--win32/PlatWin.h8
1 files changed, 8 insertions, 0 deletions
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<LONG>(pt.x), static_cast<LONG>(pt.y) };
+}
+
+constexpr Point PointFromPOINT(POINT pt) noexcept {
+ return Point::FromInts(pt.x, pt.y);
+}
+
constexpr HWND HwndFromWindowID(WindowID wid) noexcept {
return static_cast<HWND>(wid);
}