mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:25:55 +00:00
[MSPAINT] Define GRIP_SIZE macro and use it (#4192)
Reduce magic numbers. CORE-17931
This commit is contained in:
parent
9e1386db43
commit
614354ccb5
7 changed files with 51 additions and 53 deletions
|
@ -65,31 +65,24 @@ ForceRefreshSelectionContents()
|
|||
|
||||
int CSelectionWindow::IdentifyCorner(int iXPos, int iYPos, int iWidth, int iHeight)
|
||||
{
|
||||
if (iYPos < 3)
|
||||
{
|
||||
if (iXPos < 3)
|
||||
return ACTION_RESIZE_TOP_LEFT;
|
||||
if ((iXPos < iWidth / 2 + 2) && (iXPos >= iWidth / 2 - 1))
|
||||
return ACTION_RESIZE_TOP;
|
||||
if (iXPos >= iWidth - 3)
|
||||
return ACTION_RESIZE_TOP_RIGHT;
|
||||
}
|
||||
if ((iYPos < iHeight / 2 + 2) && (iYPos >= iHeight / 2 - 1))
|
||||
{
|
||||
if (iXPos < 3)
|
||||
return ACTION_RESIZE_LEFT;
|
||||
if (iXPos >= iWidth - 3)
|
||||
return ACTION_RESIZE_RIGHT;
|
||||
}
|
||||
if (iYPos >= iHeight - 3)
|
||||
{
|
||||
if (iXPos < 3)
|
||||
return ACTION_RESIZE_BOTTOM_LEFT;
|
||||
if ((iXPos < iWidth / 2 + 2) && (iXPos >= iWidth / 2 - 1))
|
||||
return ACTION_RESIZE_BOTTOM;
|
||||
if (iXPos >= iWidth - 3)
|
||||
return ACTION_RESIZE_BOTTOM_RIGHT;
|
||||
}
|
||||
POINT pt = { iXPos, iYPos };
|
||||
HWND hwndChild = ChildWindowFromPointEx(pt, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED);
|
||||
if (hwndChild == sizeboxLeftTop)
|
||||
return ACTION_RESIZE_TOP_LEFT;
|
||||
if (hwndChild == sizeboxCenterTop)
|
||||
return ACTION_RESIZE_TOP;
|
||||
if (hwndChild == sizeboxRightTop)
|
||||
return ACTION_RESIZE_TOP_RIGHT;
|
||||
if (hwndChild == sizeboxRightCenter)
|
||||
return ACTION_RESIZE_RIGHT;
|
||||
if (hwndChild == sizeboxLeftCenter)
|
||||
return ACTION_RESIZE_LEFT;
|
||||
if (hwndChild == sizeboxCenterBottom)
|
||||
return ACTION_RESIZE_BOTTOM;
|
||||
if (hwndChild == sizeboxRightBottom)
|
||||
return ACTION_RESIZE_BOTTOM_RIGHT;
|
||||
if (hwndChild == sizeboxLeftBottom)
|
||||
return ACTION_RESIZE_BOTTOM_LEFT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -197,8 +190,8 @@ LRESULT CSelectionWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, B
|
|||
}
|
||||
else
|
||||
{
|
||||
int w = Zoomed(selectionModel.GetDestRectWidth()) + 6;
|
||||
int h = Zoomed(selectionModel.GetDestRectHeight()) + 6;
|
||||
int w = Zoomed(selectionModel.GetDestRectWidth()) + 2 * GRIP_SIZE;
|
||||
int h = Zoomed(selectionModel.GetDestRectHeight()) + 2 * GRIP_SIZE;
|
||||
m_ptPos.x = GET_X_LPARAM(lParam);
|
||||
m_ptPos.y = GET_Y_LPARAM(lParam);
|
||||
SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue