https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb245ff7119466d05d000…
commit cb245ff7119466d05d000343ac6a3c0db996b3a1
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Tue Jun 13 14:57:59 2023 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Tue Jun 13 14:57:59 2023 +0900
[MSPAINT] Scrolled canvas has defects in dragging a selection
CORE-18990, CORE-18867
---
base/applications/mspaint/canvas.cpp | 18 +++++++++---------
base/applications/mspaint/canvas.h | 8 ++++----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp
index e6977e3c2c0..a6aa9b461f9 100644
--- a/base/applications/mspaint/canvas.cpp
+++ b/base/applications/mspaint/canvas.cpp
@@ -258,7 +258,7 @@ LRESULT CCanvasWindow::OnLRButtonDown(BOOL bLeftButton, UINT nMsg,
WPARAM wParam
{
if (bLeftButton)
{
- UnZoomed(pt);
+ CanvasToImage(pt);
StartSelectionDrag(hitSelection, pt);
}
return 0;
@@ -741,7 +741,7 @@ VOID CCanvasWindow::finishDrawing()
Invalidate(FALSE);
}
-CANVAS_HITTEST CCanvasWindow::SelectionHitTest(POINT ptZoomed)
+CANVAS_HITTEST CCanvasWindow::SelectionHitTest(POINT ptImage)
{
if (!selectionModel.m_bShow)
return HIT_NONE;
@@ -751,28 +751,28 @@ CANVAS_HITTEST CCanvasWindow::SelectionHitTest(POINT ptZoomed)
::OffsetRect(&rcSelection, GRIP_SIZE - GetScrollPos(SB_HORZ), GRIP_SIZE -
GetScrollPos(SB_VERT));
::InflateRect(&rcSelection, GRIP_SIZE, GRIP_SIZE);
- return getSizeBoxHitTest(ptZoomed, &rcSelection);
+ return getSizeBoxHitTest(ptImage, &rcSelection);
}
-VOID CCanvasWindow::StartSelectionDrag(CANVAS_HITTEST hit, POINT ptUnZoomed)
+VOID CCanvasWindow::StartSelectionDrag(CANVAS_HITTEST hit, POINT ptImage)
{
m_hitSelection = hit;
- selectionModel.m_ptHit = ptUnZoomed;
+ selectionModel.m_ptHit = ptImage;
selectionModel.TakeOff();
SetCapture();
Invalidate(FALSE);
}
-VOID CCanvasWindow::SelectionDragging(POINT ptUnZoomed)
+VOID CCanvasWindow::SelectionDragging(POINT ptImage)
{
- selectionModel.Dragging(m_hitSelection, ptUnZoomed);
+ selectionModel.Dragging(m_hitSelection, ptImage);
Invalidate(FALSE);
}
-VOID CCanvasWindow::EndSelectionDrag(POINT ptUnZoomed)
+VOID CCanvasWindow::EndSelectionDrag(POINT ptImage)
{
- selectionModel.Dragging(m_hitSelection, ptUnZoomed);
+ selectionModel.Dragging(m_hitSelection, ptImage);
m_hitSelection = HIT_NONE;
Invalidate(FALSE);
}
diff --git a/base/applications/mspaint/canvas.h b/base/applications/mspaint/canvas.h
index 4a41652adc0..a201bdc2c7a 100644
--- a/base/applications/mspaint/canvas.h
+++ b/base/applications/mspaint/canvas.h
@@ -61,10 +61,10 @@ protected:
VOID OnHVScroll(WPARAM wParam, INT fnBar);
VOID drawZoomFrame(INT mouseX, INT mouseY);
- CANVAS_HITTEST SelectionHitTest(POINT ptZoomed);
- VOID StartSelectionDrag(CANVAS_HITTEST hit, POINT ptUnZoomed);
- VOID SelectionDragging(POINT ptUnZoomed);
- VOID EndSelectionDrag(POINT ptUnZoomed);
+ CANVAS_HITTEST SelectionHitTest(POINT ptImage);
+ VOID StartSelectionDrag(CANVAS_HITTEST hit, POINT ptImage);
+ VOID SelectionDragging(POINT ptImage);
+ VOID EndSelectionDrag(POINT ptImage);
LRESULT OnSize(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnHScroll(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);