aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/PlatWin.cxx6
-rw-r--r--win32/PlatWin.h4
-rw-r--r--win32/ScintillaWin.cxx2
3 files changed, 8 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 7598f9447..930c0fa8b 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -2765,7 +2765,7 @@ void Window::Destroy() noexcept {
PRectangle Window::GetPosition() const {
RECT rc;
::GetWindowRect(HwndFromWindowID(wid), &rc);
- return PRectangle::FromInts(rc.left, rc.top, rc.right, rc.bottom);
+ return PRectangleFromRECT(rc);
}
void Window::SetPosition(PRectangle rc) {
@@ -2829,7 +2829,7 @@ PRectangle Window::GetClientPosition() const {
RECT rc={0,0,0,0};
if (wid)
::GetClientRect(HwndFromWindowID(wid), &rc);
- return PRectangle::FromInts(rc.left, rc.top, rc.right, rc.bottom);
+ return PRectangleFromRECT(rc);
}
void Window::Show(bool show) {
@@ -3637,7 +3637,7 @@ void ListBoxX::AdjustWindowRect(PRectangle *rc, UINT dpiAdjust) const noexcept {
} else {
::AdjustWindowRectEx(&rcw, frameStyle, false, WS_EX_WINDOWEDGE);
}
- *rc = PRectangle::FromInts(rcw.left, rcw.top, rcw.right, rcw.bottom);
+ *rc = PRectangleFromRECT(rcw);
}
int ListBoxX::ItemHeight() const noexcept {
diff --git a/win32/PlatWin.h b/win32/PlatWin.h
index 86022a0cd..6c51ec8ad 100644
--- a/win32/PlatWin.h
+++ b/win32/PlatWin.h
@@ -24,6 +24,10 @@ constexpr RECT RectFromPRectangle(PRectangle prc) noexcept {
return rc;
}
+constexpr PRectangle PRectangleFromRECT(RECT rc) noexcept {
+ return PRectangle::FromInts(rc.left, rc.top, rc.right, rc.bottom);
+}
+
constexpr POINT POINTFromPoint(Point pt) noexcept {
return POINT{ static_cast<LONG>(pt.x), static_cast<LONG>(pt.y) };
}
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx
index af20467ad..4ce8aad0c 100644
--- a/win32/ScintillaWin.cxx
+++ b/win32/ScintillaWin.cxx
@@ -1278,7 +1278,7 @@ sptr_t ScintillaWin::WndPaint() {
hRgnUpdate = ::CreateRectRgn(0, 0, 0, 0);
::GetUpdateRgn(MainHWND(), hRgnUpdate, FALSE);
::BeginPaint(MainHWND(), &ps);
- rcPaint = PRectangle::FromInts(ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom);
+ rcPaint = PRectangleFromRECT(ps.rcPaint);
const PRectangle rcClient = GetClientRectangle();
paintingAllText = BoundsContains(rcPaint, hRgnUpdate, rcClient);
if (!PaintDC(ps.hdc)) {