mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
[MSPAINT] Add selectionModel.hitTest and use it
Refactoring. CORE-19094
This commit is contained in:
parent
df54fb01fd
commit
c2bb5aa01d
4 changed files with 14 additions and 16 deletions
|
@ -317,7 +317,7 @@ LRESULT CCanvasWindow::OnButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO
|
|||
return 0;
|
||||
}
|
||||
|
||||
HITTEST hitSelection = SelectionHitTest(pt);
|
||||
HITTEST hitSelection = selectionModel.hitTest(pt);
|
||||
if (hitSelection != HIT_NONE)
|
||||
{
|
||||
selectionModel.m_nSelectionBrush = 0; // Selection Brush is OFF
|
||||
|
@ -634,7 +634,7 @@ LRESULT CCanvasWindow::OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL
|
|||
return 0;
|
||||
}
|
||||
|
||||
HITTEST hitSelection = SelectionHitTest(pt);
|
||||
HITTEST hitSelection = selectionModel.hitTest(pt);
|
||||
if (hitSelection != HIT_NONE)
|
||||
{
|
||||
if (!setCursorOnSizeBox(hitSelection))
|
||||
|
@ -746,19 +746,6 @@ VOID CCanvasWindow::finishDrawing()
|
|||
Invalidate(FALSE);
|
||||
}
|
||||
|
||||
HITTEST CCanvasWindow::SelectionHitTest(POINT ptImage)
|
||||
{
|
||||
if (!selectionModel.m_bShow)
|
||||
return HIT_NONE;
|
||||
|
||||
RECT rcSelection = selectionModel.m_rc;
|
||||
Zoomed(rcSelection);
|
||||
::OffsetRect(&rcSelection, GRIP_SIZE - GetScrollPos(SB_HORZ), GRIP_SIZE - GetScrollPos(SB_VERT));
|
||||
::InflateRect(&rcSelection, GRIP_SIZE, GRIP_SIZE);
|
||||
|
||||
return getSizeBoxHitTest(ptImage, &rcSelection);
|
||||
}
|
||||
|
||||
VOID CCanvasWindow::StartSelectionDrag(HITTEST hit, POINT ptImage)
|
||||
{
|
||||
m_hitSelection = hit;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue