Skip to content

Commit

Permalink
[MSPAINT] Check out of image in updating status bar (#5779)
Browse files Browse the repository at this point in the history
Check out of the image by using ::PtInRect and CCanvasWindow::GetImageRect.
If out, then don't show the status bar text.
CORE-19219
  • Loading branch information
katahiromz committed Oct 8, 2023
1 parent 611d89e commit 0c164f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/applications/mspaint/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,12 @@ LRESULT CCanvasWindow::OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL

if (!m_drawing)
{
RECT rcImage;
GetImageRect(rcImage);

CString strCoord;
strCoord.Format(_T("%ld, %ld"), pt.x, pt.y);
if (::PtInRect(&rcImage, pt))
strCoord.Format(_T("%ld, %ld"), pt.x, pt.y);
::SendMessage(g_hStatusBar, SB_SETTEXT, 1, (LPARAM) (LPCTSTR) strCoord);
}
}
Expand Down

0 comments on commit 0c164f0

Please sign in to comment.