mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:13:06 +00:00
[MSPAINT] Define SelectionBaseTool and use it (#6034)
Refactoring and arrangement for selection handling. - Move some selection-related codes in canvas.cpp to mouse.cpp. - Add SelectionBaseTool structure for FreeSelTool and RectSelTool. CORE-19094
This commit is contained in:
parent
898fb5f414
commit
f710e5a260
5 changed files with 212 additions and 262 deletions
|
@ -963,29 +963,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
|||
textEditWindow.PostMessage(WM_UNDO, 0, 0);
|
||||
break;
|
||||
}
|
||||
if (selectionModel.m_bShow)
|
||||
{
|
||||
if (toolsModel.IsSelection())
|
||||
{
|
||||
canvasWindow.cancelDrawing();
|
||||
if (toolsModel.GetActiveTool() == TOOL_FREESEL ||
|
||||
toolsModel.GetActiveTool() == TOOL_RECTSEL)
|
||||
{
|
||||
imageModel.Undo();
|
||||
if (selectionModel.m_nSelectionBrush == 2) // Selection Brush is drawn
|
||||
{
|
||||
imageModel.Undo();
|
||||
selectionModel.m_nSelectionBrush = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ToolBase::s_pointSP != 0) // drawing something?
|
||||
{
|
||||
canvasWindow.cancelDrawing();
|
||||
break;
|
||||
}
|
||||
canvasWindow.finishDrawing();
|
||||
imageModel.Undo();
|
||||
break;
|
||||
case IDM_EDITREDO:
|
||||
|
@ -994,11 +972,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
|||
// There is no "WM_REDO" in EDIT control
|
||||
break;
|
||||
}
|
||||
if (ToolBase::s_pointSP != 0) // drawing something?
|
||||
{
|
||||
canvasWindow.finishDrawing();
|
||||
break;
|
||||
}
|
||||
canvasWindow.finishDrawing();
|
||||
imageModel.Redo();
|
||||
break;
|
||||
case IDM_EDITCOPY:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue