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
commit90a498aa44da18855534f4e8b001de07460ccb72 (patch)
treeaf1d8fef272b53b1b0d261eb1a24314fbaba9dbe /win32/PlatWin.h
parentfb900ef3e4342b79a529a99fd120e628ab53f400 (diff)
downloadscintilla-mirror-90a498aa44da18855534f4e8b001de07460ccb72.tar.gz
Backport: Feature [feature-requests:#1340] Move and use Point functions to avoid casting.
Backport of changeset 7976:4ba647207671.
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 01e321e4c..f4f804b2e 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -15,6 +15,14 @@ extern void Platform_Finalise(bool fromDllMain);
RECT RectFromPRectangle(PRectangle prc) noexcept;
+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);
}