[MSPAINT] Polymorphism on tools (#4210)

- Introduce polymorphism on tools and mouse actions.
- Implement double-clicking on TOOL_SHAPE.
- Fix some bugs about mouse handling.
CORE-17931
This commit is contained in:
Katayama Hirofumi MZ 2022-01-01 22:02:36 +09:00 committed by GitHub
parent e0a47b7b5f
commit ee132a05ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 790 additions and 635 deletions

View file

@ -176,7 +176,23 @@ LRESULT CScrollboxWindow::OnVScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO
LRESULT CScrollboxWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
selectionWindow.ShowWindow(SW_HIDE);
pointSP = 0; // resets the point-buffer of the polygon and bezier functions
switch (toolsModel.GetActiveTool())
{
case TOOL_BEZIER:
case TOOL_SHAPE:
if (ToolBase::pointSP != 0)
{
toolsModel.OnCancelDraw();
imageArea.Invalidate();
}
break;
default:
break;
}
toolsModel.resetTool(); // resets the point-buffer of the polygon and bezier functions
return 0;
}