aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-04-06 00:00:52 +0000
committernyamatongwe <unknown>2003-04-06 00:00:52 +0000
commitd533f4848830d2c85b2e81e5a66d83db1f9f32f0 (patch)
treea9bd40f0adfe163f4803d05d1de296a707ccf51f /win32/PlatWin.cxx
parent2cbcba20e38fe5978a8aae79d41c1f6c56a3bc3b (diff)
downloadscintilla-mirror-d533f4848830d2c85b2e81e5a66d83db1f9f32f0.tar.gz
Move method for Rectangle class.
Ensure windows that are moved are not moved off screen to the top or left.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 09bf83ded..d2b88bda3 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -769,10 +769,13 @@ void Window::SetPositionRelative(PRectangle rc, Window w) {
if (style & WS_POPUP) {
RECT rcOther;
::GetWindowRect(reinterpret_cast<HWND>(w.GetID()), &rcOther);
- rc.top += rcOther.top;
- rc.left += rcOther.left;
- rc.bottom += rcOther.top;
- rc.right += rcOther.left;
+ rc.Move(rcOther.left, rcOther.top);
+ if (rc.left < 0) {
+ rc.Move(-rc.left,0);
+ }
+ if (rc.top < 0) {
+ rc.Move(0,-rc.top);
+ }
}
SetPosition(rc);
}