[MSPAINT] Refactor ImageModel (#5335)

- Unify ImageModel::Insert and ImageModel::CopyPrevious to ImageModel::PushImageForUndo.
- Delete useless stuffs.
- Fix some memory leaks.
- Fix IDM_IMAGECROP.
CORE-17969, CORE-18867
This commit is contained in:
Katayama Hirofumi MZ 2023-06-13 23:23:48 +09:00 committed by GitHub
parent 70f897e4c9
commit 2b623c1d04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 144 additions and 183 deletions

View file

@ -194,7 +194,7 @@ void SelectionModel::Landing()
ClearMask();
ClearColor();
imageModel.CopyPrevious();
imageModel.PushImageForUndo();
}
void SelectionModel::InsertFromHBITMAP(HBITMAP hBm, INT x, INT y)
@ -445,7 +445,7 @@ void SelectionModel::CancelSelection()
if (!m_bShow)
return;
imageModel.CopyPrevious();
imageModel.PushImageForUndo();
if (m_bShow)
imageModel.Undo(TRUE);