mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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
|
@ -155,7 +155,7 @@ VOID CCanvasWindow::DoDraw(HDC hDC, RECT& rcClient, RECT& rcPaint)
|
|||
}
|
||||
|
||||
// Draw new frame if any
|
||||
if (!::IsRectEmpty(&m_rcNew))
|
||||
if (m_whereHit != HIT_NONE && !::IsRectEmpty(&m_rcNew))
|
||||
DrawXorRect(hdcMem, &m_rcNew);
|
||||
|
||||
// Transfer the bits
|
||||
|
@ -668,8 +668,9 @@ LRESULT CCanvasWindow::OnKeyDown(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL&
|
|||
if (wParam == VK_ESCAPE && ::GetCapture() == m_hWnd)
|
||||
{
|
||||
// Cancel dragging
|
||||
m_whereHit = HIT_NONE;
|
||||
::ReleaseCapture();
|
||||
m_whereHit = HIT_NONE;
|
||||
::SetRectEmpty(&m_rcNew);
|
||||
Invalidate(TRUE);
|
||||
}
|
||||
|
||||
|
@ -680,6 +681,7 @@ LRESULT CCanvasWindow::OnCancelMode(UINT nMsg, WPARAM wParam, LPARAM lParam, BOO
|
|||
{
|
||||
// Cancel dragging
|
||||
m_whereHit = HIT_NONE;
|
||||
::SetRectEmpty(&m_rcNew);
|
||||
Invalidate(TRUE);
|
||||
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_EDITCOPYTO, ENABLED_IF(trueSelection));
|
||||
OpenClipboard();
|
||||
EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(GetClipboardData(CF_BITMAP) != NULL));
|
||||
EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(IsClipboardFormatAvailable(CF_BITMAP)));
|
||||
CloseClipboard();
|
||||
break;
|
||||
case 2: /* View menu */
|
||||
|
@ -661,7 +661,7 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
|
|||
break;
|
||||
case IDM_EDITPASTE:
|
||||
OpenClipboard();
|
||||
if (GetClipboardData(CF_BITMAP) != NULL)
|
||||
if (IsClipboardFormatAvailable(CF_BITMAP))
|
||||
{
|
||||
InsertSelectionFromHBITMAP((HBITMAP) GetClipboardData(CF_BITMAP), m_hWnd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue