[MSPAINT] Improve Undo/Redo and finishing tool (#4324)

- Fix Undo/Redo mechanism.
- Finish drawing when the tool is to be chanaged and when the file is to be saved.
- Add ToolBase::OnFinishDraw to virtualize finishing drawing.
- Extend bClearRedo parameter to ImageModel::Undo.
- Add ImageModel::DrawSelectionBackground and ImageModel::DeleteSelection methods.
- Fix some WM_PAINT message handling.
CORE-17969
This commit is contained in:
Katayama Hirofumi MZ 2022-01-30 12:05:23 +09:00 committed by GitHub
parent c5b029d0fc
commit 0839711566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 313 additions and 151 deletions

View file

@ -19,9 +19,9 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
HBRUSH oldBrush;
int i, a, b;
DefWindowProc(WM_PAINT, wParam, lParam);
PAINTSTRUCT ps;
HDC hDC = BeginPaint(&ps);
HDC hDC = GetDC();
for(b = 2; b < 30; b++)
for(a = 2; a < 29; a++)
if ((a + b) % 2 == 1)
@ -54,7 +54,7 @@ LRESULT CPaletteWindow::OnPaint(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& b
DeleteObject(SelectObject(hDC, oldBrush));
DeleteObject(SelectObject(hDC, oldPen));
}
ReleaseDC(hDC);
EndPaint(&ps);
return 0;
}