mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 05:58:13 +00:00
[MSPAINT] Canvas: Don't draw new frame if HIT_NONE
CORE-18867
This commit is contained in:
parent
132f482de2
commit
f45d80adc9
2 changed files with 6 additions and 4 deletions
base/applications/mspaint
|
@ -155,7 +155,7 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw new frame if any
|
// Draw new frame if any
|
||||||
if (!::IsRectEmpty(&m_rcNew))
|
if (m_whereHit != HIT_NONE && !::IsRectEmpty(&m_rcNew))
|
||||||
DrawXorRect(hdcMem, &m_rcNew);
|
DrawXorRect(hdcMem, &m_rcNew);
|
||||||
|
|
||||||
// Transfer the bits
|
// Transfer the bits
|
||||||
|
@ -668,8 +668,9 @@ LRESULT CCanvasWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
|
||||||
if (wParam == VK_ESCAPE && ::GetCapture() == m_hWnd)
|
if (wParam == VK_ESCAPE && ::GetCapture() == m_hWnd)
|
||||||
{
|
{
|
||||||
// Cancel dragging
|
// Cancel dragging
|
||||||
m_whereHit = HIT_NONE;
|
|
||||||
::ReleaseCapture();
|
::ReleaseCapture();
|
||||||
|
m_whereHit = HIT_NONE;
|
||||||
|
::SetRectEmpty(&m_rcNew);
|
||||||
Invalidate(TRUE);
|
Invalidate(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -680,6 +681,7 @@ LRESULT CCanvasWindow::OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO
|
||||||
{
|
{
|
||||||
// Cancel dragging
|
// Cancel dragging
|
||||||
m_whereHit = HIT_NONE;
|
m_whereHit = HIT_NONE;
|
||||||
|
::SetRectEmpty(&m_rcNew);
|
||||||
Invalidate(TRUE);
|
Invalidate(TRUE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -439,7 +439,7 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO
|
||||||
EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
|
EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
|
||||||
EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
|
EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
|
||||||
OpenClipboard();
|
OpenClipboard();
|
||||||
EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(GetClipboardData(CF_BITMAP) != NULL));
|
EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(IsClipboardFormatAvailable(CF_BITMAP)));
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
break;
|
break;
|
||||||
case 2: /* View menu */
|
case 2: /* View menu */
|
||||||
|
@ -661,7 +661,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
||||||
break;
|
break;
|
||||||
case IDM_EDITPASTE:
|
case IDM_EDITPASTE:
|
||||||
OpenClipboard();
|
OpenClipboard();
|
||||||
if (GetClipboardData(CF_BITMAP) != NULL)
|
if (IsClipboardFormatAvailable(CF_BITMAP))
|
||||||
{
|
{
|
||||||
InsertSelectionFromHBITMAP((HBITMAP) GetClipboardData(CF_BITMAP), m_hWnd);
|
InsertSelectionFromHBITMAP((HBITMAP) GetClipboardData(CF_BITMAP), m_hWnd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue