From 3fa6d74a01c149355633fc41c4d955098bea4d95 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Thu, 22 Jun 2023 07:19:48 +0900 Subject: [PATCH] [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(); }