[MSPAINT] Improve behaviour on memory shortage (#7780)

Improve UX on memory shortage.
JIRA issue: CORE-20020
- Clear history on memory shortage.
- Improve CCanvasWindow::OnPaint on memory
  shortage.
- Add null check in CCanvasWindow::DoDraw.
- Retire using of cache in CCanvasWindow.
This commit is contained in:
Katayama Hirofumi MZ 2025-03-25 10:45:23 +09:00 committed by GitHub
parent c930c8c464
commit 9563c07146
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 47 additions and 18 deletions

View file

@ -130,6 +130,7 @@ void ImageModel::PushImageForUndo()
if (hbm == NULL)
{
ShowOutOfMemory();
ClearHistory();
return;
}
@ -143,6 +144,7 @@ void ImageModel::PushImageForUndo(HBITMAP hbm)
if (hbm == NULL)
{
ShowOutOfMemory();
ClearHistory();
return;
}
@ -201,6 +203,7 @@ void ImageModel::Crop(int nWidth, int nHeight, int nOffsetX, int nOffsetY)
if (!hbmNew)
{
ShowOutOfMemory();
ClearHistory();
return;
}