mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[MSPAINT] Reset scroll position in some situations (#5789)
In some situations, the scroll position should be reset. - Add CCanvasWindow::resetScrollPos method. - Reset the scroll position on loading a file. - Reset the scroll position on mirroring/rotating the image. CORE-19094
This commit is contained in:
parent
9a51c8e6c6
commit
1183e797b4
4 changed files with 9 additions and 0 deletions
|
@ -199,6 +199,12 @@ VOID CCanvasWindow::updateScrollInfo()
|
|||
SetScrollInfo(SB_VERT, &si);
|
||||
}
|
||||
|
||||
VOID CCanvasWindow::resetScrollPos()
|
||||
{
|
||||
SetScrollPos(SB_HORZ, 0);
|
||||
SetScrollPos(SB_VERT, 0);
|
||||
}
|
||||
|
||||
LRESULT CCanvasWindow::OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
if (m_hWnd)
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
VOID cancelDrawing();
|
||||
VOID finishDrawing();
|
||||
VOID updateScrollInfo();
|
||||
VOID resetScrollPos();
|
||||
|
||||
VOID ImageToCanvas(POINT& pt);
|
||||
VOID ImageToCanvas(RECT& rc);
|
||||
|
|
|
@ -241,6 +241,7 @@ HBITMAP InitializeImage(LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile)
|
|||
HBITMAP SetBitmapAndInfo(HBITMAP hBitmap, LPCWSTR name, LPWIN32_FIND_DATAW pFound, BOOL isFile)
|
||||
{
|
||||
// update image
|
||||
canvasWindow.resetScrollPos();
|
||||
imageModel.PushImageForUndo(hBitmap);
|
||||
imageModel.ClearHistory();
|
||||
|
||||
|
|
|
@ -921,6 +921,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
|||
case IDM_IMAGEROTATEMIRROR:
|
||||
{
|
||||
CWaitCursor waitCursor;
|
||||
canvasWindow.resetScrollPos();
|
||||
switch (mirrorRotateDialog.DoModal(mainWindow.m_hWnd))
|
||||
{
|
||||
case 1: /* flip horizontally */
|
||||
|
|
Loading…
Reference in a new issue