mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 20:33:48 +00:00
[MSPAINT] Larger/smaller pen nib on Ctrl+Plus/Minus (#5738)
- Introduce the concept of pen width (not line width) to the tools model. - Enable changing pen/line width by Ctrl+Plus/Minus key combination in TOOL_PEN, TOOL_LINE, TOOL_BEZIER, TOOL_RECT, TOOL_SHAPE, TOO_ELLIPSE, and TOOL_RRECT tools. CORE-19094
This commit is contained in:
parent
cbc63d876c
commit
f2a012240f
6 changed files with 89 additions and 27 deletions
|
@ -320,6 +320,11 @@ struct TwoPointDrawTool : ToolBase
|
|||
m_bDrawing = FALSE;
|
||||
ToolBase::OnCancelDraw();
|
||||
}
|
||||
|
||||
void OnSpecialTweak(BOOL bMinus) override
|
||||
{
|
||||
toolsModel.MakeLineThickerOrThinner(bMinus);
|
||||
}
|
||||
};
|
||||
|
||||
typedef enum DIRECTION
|
||||
|
@ -499,8 +504,6 @@ struct RubberTool : SmoothDrawTool
|
|||
Erase(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_bg, toolsModel.GetRubberRadius());
|
||||
else
|
||||
Replace(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius());
|
||||
g_ptEnd.x = x;
|
||||
g_ptEnd.y = y;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -587,10 +590,12 @@ struct PenTool : SmoothDrawTool
|
|||
void draw(BOOL bLeftButton, LONG x, LONG y) override
|
||||
{
|
||||
COLORREF rgb = bLeftButton ? m_fg : m_bg;
|
||||
Line(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, 1);
|
||||
::SetPixelV(m_hdc, x, y, rgb);
|
||||
g_ptEnd.x = x;
|
||||
g_ptEnd.y = y;
|
||||
Line(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetPenWidth());
|
||||
}
|
||||
|
||||
void OnSpecialTweak(BOOL bMinus) override
|
||||
{
|
||||
toolsModel.MakePenThickerOrThinner(bMinus);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -605,8 +610,11 @@ struct BrushTool : SmoothDrawTool
|
|||
{
|
||||
COLORREF rgb = bLeftButton ? m_fg : m_bg;
|
||||
Brush(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetBrushStyle());
|
||||
g_ptEnd.x = x;
|
||||
g_ptEnd.y = y;
|
||||
}
|
||||
|
||||
void OnSpecialTweak(BOOL bMinus) override
|
||||
{
|
||||
// TODO:
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -863,6 +871,11 @@ struct BezierTool : ToolBase
|
|||
m_bDrawing = FALSE;
|
||||
ToolBase::OnFinishDraw();
|
||||
}
|
||||
|
||||
void OnSpecialTweak(BOOL bMinus) override
|
||||
{
|
||||
toolsModel.MakeLineThickerOrThinner(bMinus);
|
||||
}
|
||||
};
|
||||
|
||||
// TOOL_RECT
|
||||
|
@ -991,6 +1004,11 @@ struct ShapeTool : ToolBase
|
|||
|
||||
ToolBase::OnFinishDraw();
|
||||
}
|
||||
|
||||
void OnSpecialTweak(BOOL bMinus) override
|
||||
{
|
||||
toolsModel.MakeLineThickerOrThinner(bMinus);
|
||||
}
|
||||
};
|
||||
|
||||
// TOOL_ELLIPSE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue