https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0c164f081aa9330992a4f…
commit 0c164f081aa9330992a4f81a61a425d015f4d1c9
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Oct 9 08:39:31 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Oct 9 08:39:31 2023 +0900
[MSPAINT] Check out of image in updating status bar (#5779)
Check out of the image by using ::PtInRect and CCanvasWindow::GetImageRect.
If out, then don't show the status bar text.
CORE-19219
---
base/applications/mspaint/canvas.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp
index a4eeead446b..ae860cb4d24 100644
--- a/base/applications/mspaint/canvas.cpp
+++ b/base/applications/mspaint/canvas.cpp
@@ -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);
}
}