[MSPAINT] Larger/smaller Rubber/AirBrush on Ctrl+Plus/Minus (#5740)

- Enable changing rubber/airbrush thickness by Ctrl+Plus / Ctrl+Minus
  key combination in TOOL_AIRBRUSH and TOOL_RUBBER.
CORE-19094
This commit is contained in:
Katayama Hirofumi MZ 2023-09-28 21:54:32 +09:00 committed by GitHub
parent 8a4787b384
commit 945ee4b2a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 0 deletions

View file

@ -505,6 +505,11 @@ struct RubberTool : SmoothDrawTool
else
Replace(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius());
}
void OnSpecialTweak(BOOL bMinus) override
{
toolsModel.MakeRubberThickerOrThinner(bMinus);
}
};
// TOOL_FILL
@ -631,6 +636,11 @@ struct AirBrushTool : SmoothDrawTool
COLORREF rgb = bLeftButton ? m_fg : m_bg;
Airbrush(m_hdc, x, y, rgb, toolsModel.GetAirBrushWidth());
}
void OnSpecialTweak(BOOL bMinus) override
{
toolsModel.MakeAirBrushThickerOrThinner(bMinus);
}
};
// TOOL_TEXT

View file

@ -99,6 +99,18 @@ void ToolsModel::MakeBrushThickerOrThinner(BOOL bThinner)
SetBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1));
}
void ToolsModel::MakeAirBrushThickerOrThinner(BOOL bThinner)
{
INT thickness = GetAirBrushWidth();
SetAirBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1));
}
void ToolsModel::MakeRubberThickerOrThinner(BOOL bThinner)
{
INT thickness = GetRubberRadius();
SetRubberRadius(bThinner ? max(1, thickness - 1) : (thickness + 1));
}
int ToolsModel::GetShapeStyle() const
{
return m_shapeStyle;

View file

@ -120,9 +120,11 @@ public:
int GetAirBrushWidth() const;
void SetAirBrushWidth(int nAirBrushWidth);
void MakeAirBrushThickerOrThinner(BOOL bThinner);
int GetRubberRadius() const;
void SetRubberRadius(int nRubberRadius);
void MakeRubberThickerOrThinner(BOOL bThinner);
BOOL IsBackgroundTransparent() const;
void SetBackgroundTransparent(BOOL bTransparent);