mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 22:02:57 +00:00
[MSPAINT] Improve Undo/Redo handling of selection (#6035)
Consistent behavior of the application. - Add ShiftPtStack and BuildMaskFromPtStack helper functions. - Move some codes of selectionModel to mouse.cpp. CORE-19226
This commit is contained in:
parent
ab0119c61f
commit
b8598e095d
10 changed files with 134 additions and 205 deletions
|
@ -648,9 +648,9 @@ LRESULT CCanvasWindow::OnSetCursor(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL
|
|||
|
||||
LRESULT CCanvasWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
if (wParam == VK_ESCAPE && ::GetCapture() == m_hWnd)
|
||||
if (wParam == VK_ESCAPE)
|
||||
{
|
||||
cancelDrawing();
|
||||
OnEndDraw(TRUE);
|
||||
::ReleaseCapture();
|
||||
m_nMouseDownMsg = 0;
|
||||
m_hitCanvasSizeBox = HIT_NONE;
|
||||
|
@ -698,19 +698,10 @@ LRESULT CCanvasWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
|||
return 0;
|
||||
}
|
||||
|
||||
VOID CCanvasWindow::cancelDrawing()
|
||||
VOID CCanvasWindow::OnEndDraw(BOOL bCancel)
|
||||
{
|
||||
selectionModel.ClearColorImage();
|
||||
selectionModel.ClearMaskImage();
|
||||
m_drawing = FALSE;
|
||||
toolsModel.OnEndDraw(TRUE);
|
||||
Invalidate(FALSE);
|
||||
}
|
||||
|
||||
VOID CCanvasWindow::finishDrawing()
|
||||
{
|
||||
toolsModel.OnEndDraw(FALSE);
|
||||
m_drawing = FALSE;
|
||||
toolsModel.OnEndDraw(bCancel);
|
||||
Invalidate(FALSE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue