https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3fa6d74a01c149355633fc...
commit 3fa6d74a01c149355633fc41c4d955098bea4d95 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Thu Jun 22 07:19:48 2023 +0900 Commit: GitHub noreply@github.com CommitDate: Thu Jun 22 07:19:48 2023 +0900
[MSPAINT] Fix ShapeTool with Shift key (#5358)
Fix the behavior of the ShapeTool in pressing Shift key. CORE-18867 --- base/applications/mspaint/mouse.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 2ba45a2d0e2..29959f1bb38 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -791,6 +791,9 @@ struct ShapeTool : ToolBase m_bLeftButton = bLeftButton; m_bClosed = FALSE;
+ if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) + roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y); + pointStack[pointSP].x = x; pointStack[pointSP].y = y;
@@ -812,12 +815,12 @@ struct ShapeTool : ToolBase
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override { - pointStack[pointSP].x = x; - pointStack[pointSP].y = y; - if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0)) roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y);
+ pointStack[pointSP].x = x; + pointStack[pointSP].y = y; + imageModel.NotifyImageChanged(); }