mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 15:07:53 +00:00
[MSPAINT] Fix ShapeTool with Shift key (#5358)
Fix the behavior of the ShapeTool in pressing Shift key. CORE-18867
This commit is contained in:
parent
e7ccb36b9b
commit
3fa6d74a01
|
@ -791,6 +791,9 @@ struct ShapeTool : ToolBase
|
||||||
m_bLeftButton = bLeftButton;
|
m_bLeftButton = bLeftButton;
|
||||||
m_bClosed = FALSE;
|
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].x = x;
|
||||||
pointStack[pointSP].y = y;
|
pointStack[pointSP].y = y;
|
||||||
|
|
||||||
|
@ -812,12 +815,12 @@ struct ShapeTool : ToolBase
|
||||||
|
|
||||||
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override
|
void OnMouseMove(BOOL bLeftButton, LONG x, LONG y) override
|
||||||
{
|
{
|
||||||
pointStack[pointSP].x = x;
|
|
||||||
pointStack[pointSP].y = y;
|
|
||||||
|
|
||||||
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
|
if ((pointSP > 0) && (GetAsyncKeyState(VK_SHIFT) < 0))
|
||||||
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y);
|
roundTo8Directions(pointStack[pointSP - 1].x, pointStack[pointSP - 1].y, x, y);
|
||||||
|
|
||||||
|
pointStack[pointSP].x = x;
|
||||||
|
pointStack[pointSP].y = y;
|
||||||
|
|
||||||
imageModel.NotifyImageChanged();
|
imageModel.NotifyImageChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue