Fix floating panel movement issue in RTL mode

Fix #10579, close #10586
pull/10600/head
Ashfaaq18 2021-09-23 13:21:49 +05:30 committed by Don Ho
parent d11d2c7f23
commit d939e4a6ed
1 changed files with 7 additions and 2 deletions

View File

@ -48,6 +48,8 @@ public:
void init(HINSTANCE hInst, HWND hParent) {
_hInst = hInst;
_hParent = hParent;
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(_hParent, GWL_EXSTYLE);
isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
};
void startGrip(DockingCont* pCont, DockingManager* pDockMgr);
@ -97,8 +99,8 @@ protected :
ShrinkRcToSize(rc);
};
void ShrinkRcToSize(RECT *rc) {
rc->right -= rc->left;
rc->bottom -= rc->top;
isRTL ? rc->right = rc->left - rc->right : rc->right -= rc->left;
rc->bottom -= rc->top;
};
void DoCalcGripperRect(RECT* rc, RECT rcCorr, POINT pt) {
if ((rc->left + rc->right) < pt.x)
@ -142,5 +144,8 @@ private:
// is class registered
static BOOL _isRegistered;
// get layout direction
bool isRTL;
};