[MSPAINT] Make imageArea window-less (#5215)

- Move imageArea code into canvasWindow.
- Delete imgarea.cpp, imgarea.h, and imageArea.
- Add CCanvasWindow::ImageToCanvas and CCanvasWindow::CanvasToImage to convert the coordinates.
- Realize drawing of resizing image area.
CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-04-08 22:25:27 +09:00 committed by GitHub
parent fa322c2e14
commit efe7368c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 544 additions and 666 deletions

View file

@ -151,14 +151,14 @@ struct FreeSelTool : ToolBase
selectionModel.ResetPtStack();
selectionModel.m_bShow = FALSE;
}
imageArea.Invalidate(FALSE);
canvasWindow.Invalidate(FALSE);
}
}
void OnFinishDraw()
{
if (m_bLeftButton)
imageArea.Invalidate(FALSE);
canvasWindow.Invalidate(FALSE);
m_bLeftButton = FALSE;
ToolBase::OnFinishDraw();
@ -214,14 +214,14 @@ struct RectSelTool : ToolBase
if (start.x == x && start.y == y)
imageModel.Undo(TRUE);
selectionModel.m_bShow = !selectionModel.m_rc.IsRectEmpty();
imageArea.Invalidate(FALSE);
canvasWindow.Invalidate(FALSE);
}
}
void OnFinishDraw()
{
if (m_bLeftButton)
imageArea.Invalidate(FALSE);
canvasWindow.Invalidate(FALSE);
m_bLeftButton = FALSE;
ToolBase::OnFinishDraw();
@ -417,7 +417,7 @@ struct TextTool : ToolBase
void OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick)
{
if (!textEditWindow.IsWindow())
textEditWindow.Create(imageArea);
textEditWindow.Create(canvasWindow);
imageModel.CopyPrevious();
UpdatePoint(x, y);
@ -484,7 +484,7 @@ struct TextTool : ToolBase
}
if (!textEditWindow.IsWindow())
textEditWindow.Create(imageArea);
textEditWindow.Create(canvasWindow);
textEditWindow.SetWindowText(NULL);
textEditWindow.ValidateEditRect(&rc);