mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:32:56 +00:00
[MSPAINT] "Selection Clone" and "Selection Brush" (#5734)
- Stamp the image of the selection when the user clicks on the selection while holding down the Ctrl key. - Draw the image of the selection continuously when the user starts dragging the selection while holding down the Shift key. CORE-19094
This commit is contained in:
parent
03283371c1
commit
cbc63d876c
7 changed files with 51 additions and 6 deletions
|
@ -268,9 +268,18 @@ LRESULT CCanvasWindow::OnLRButtonDown(BOOL bLeftButton, UINT nMsg, WPARAM wParam
|
|||
HITTEST hitSelection = SelectionHitTest(pt);
|
||||
if (hitSelection != HIT_NONE)
|
||||
{
|
||||
selectionModel.m_nSelectionBrush = 0; // Selection Brush is OFF
|
||||
if (bLeftButton)
|
||||
{
|
||||
CanvasToImage(pt);
|
||||
if (::GetKeyState(VK_CONTROL) < 0) // Ctrl+Click is Selection Clone
|
||||
{
|
||||
imageModel.SelectionClone();
|
||||
}
|
||||
else if (::GetKeyState(VK_SHIFT) < 0) // Shift+Dragging is Selection Brush
|
||||
{
|
||||
selectionModel.m_nSelectionBrush = 1; // Selection Brush is ON
|
||||
}
|
||||
StartSelectionDrag(hitSelection, pt);
|
||||
}
|
||||
else
|
||||
|
@ -790,6 +799,12 @@ VOID CCanvasWindow::StartSelectionDrag(HITTEST hit, POINT ptImage)
|
|||
|
||||
VOID CCanvasWindow::SelectionDragging(POINT ptImage)
|
||||
{
|
||||
if (selectionModel.m_nSelectionBrush)
|
||||
{
|
||||
imageModel.SelectionClone(selectionModel.m_nSelectionBrush == 1);
|
||||
selectionModel.m_nSelectionBrush = 2; // Selection Brush is ON and drawn
|
||||
}
|
||||
|
||||
selectionModel.Dragging(m_hitSelection, ptImage);
|
||||
Invalidate(FALSE);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue