[MSPAINT] s/AirBrushWidth/AirBrushRadius/

Fix logical error. CORE-19094
This commit is contained in:
Katayama Hirofumi MZ 2023-11-16 15:45:06 +09:00
parent 3faa56d2c7
commit 157739a658
4 changed files with 13 additions and 13 deletions

View File

@ -654,7 +654,7 @@ struct AirBrushTool : SmoothDrawTool
void draw(BOOL bLeftButton, LONG x, LONG y) override void draw(BOOL bLeftButton, LONG x, LONG y) override
{ {
COLORREF rgb = bLeftButton ? m_fg : m_bg; COLORREF rgb = bLeftButton ? m_fg : m_bg;
Airbrush(m_hdc, x, y, rgb, toolsModel.GetAirBrushWidth()); Airbrush(m_hdc, x, y, rgb, toolsModel.GetAirBrushRadius());
} }
void OnSpecialTweak(BOOL bMinus) override void OnSpecialTweak(BOOL bMinus) override

View File

@ -219,7 +219,7 @@ VOID CToolSettingsWindow::drawAirBrush(HDC hdc, LPCRECT prc)
RECT& rc = rects[i]; RECT& rc = rects[i];
INT x = (rc.left + rc.right) / 2; INT x = (rc.left + rc.right) / 2;
INT y = (rc.top + rc.bottom) / 2; INT y = (rc.top + rc.bottom) / 2;
BOOL bHigh = (s_AirRadius[i] == toolsModel.GetAirBrushWidth()); BOOL bHigh = (s_AirRadius[i] == toolsModel.GetAirBrushRadius());
if (bHigh) if (bHigh)
{ {
::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_HIGHLIGHT)); ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_HIGHLIGHT));
@ -438,7 +438,7 @@ LRESULT CToolSettingsWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lPar
case TOOL_AIRBRUSH: case TOOL_AIRBRUSH:
iItem = getAirBrushRects(rects, &rect1, &pt); iItem = getAirBrushRects(rects, &rect1, &pt);
if (iItem != -1) if (iItem != -1)
toolsModel.SetAirBrushWidth(s_AirRadius[iItem]); toolsModel.SetAirBrushRadius(s_AirRadius[iItem]);
break; break;
case TOOL_LINE: case TOOL_LINE:
case TOOL_BEZIER: case TOOL_BEZIER:

View File

@ -18,7 +18,7 @@ ToolsModel::ToolsModel()
m_shapeStyle = 0; m_shapeStyle = 0;
m_brushStyle = BrushStyleRound; m_brushStyle = BrushStyleRound;
m_oldActiveTool = m_activeTool = TOOL_PEN; m_oldActiveTool = m_activeTool = TOOL_PEN;
m_airBrushWidth = 5; m_airBrushRadius = 5;
m_rubberRadius = 4; m_rubberRadius = 4;
m_transpBg = FALSE; m_transpBg = FALSE;
m_zoom = 1000; m_zoom = 1000;
@ -99,8 +99,8 @@ void ToolsModel::MakeBrushThickerOrThinner(BOOL bThinner)
void ToolsModel::MakeAirBrushThickerOrThinner(BOOL bThinner) void ToolsModel::MakeAirBrushThickerOrThinner(BOOL bThinner)
{ {
INT thickness = GetAirBrushWidth(); INT thickness = GetAirBrushRadius();
SetAirBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); SetAirBrushRadius(bThinner ? max(1, thickness - 1) : (thickness + 1));
} }
void ToolsModel::MakeRubberThickerOrThinner(BOOL bThinner) void ToolsModel::MakeRubberThickerOrThinner(BOOL bThinner)
@ -180,14 +180,14 @@ void ToolsModel::SetActiveTool(TOOLTYPE nActiveTool)
NotifyToolChanged(); NotifyToolChanged();
} }
int ToolsModel::GetAirBrushWidth() const INT ToolsModel::GetAirBrushRadius() const
{ {
return m_airBrushWidth; return m_airBrushRadius;
} }
void ToolsModel::SetAirBrushWidth(int nAirBrushWidth) void ToolsModel::SetAirBrushRadius(INT nAirBrushRadius)
{ {
m_airBrushWidth = nAirBrushWidth; m_airBrushRadius = nAirBrushRadius;
NotifyToolSettingsChanged(); NotifyToolSettingsChanged();
} }

View File

@ -80,7 +80,7 @@ private:
BrushStyle m_brushStyle; BrushStyle m_brushStyle;
TOOLTYPE m_activeTool; TOOLTYPE m_activeTool;
TOOLTYPE m_oldActiveTool; TOOLTYPE m_oldActiveTool;
int m_airBrushWidth; INT m_airBrushRadius;
int m_rubberRadius; int m_rubberRadius;
BOOL m_transpBg; BOOL m_transpBg;
int m_zoom; int m_zoom;
@ -116,8 +116,8 @@ public:
TOOLTYPE GetOldActiveTool() const; TOOLTYPE GetOldActiveTool() const;
void SetActiveTool(TOOLTYPE nActiveTool); void SetActiveTool(TOOLTYPE nActiveTool);
int GetAirBrushWidth() const; INT GetAirBrushRadius() const;
void SetAirBrushWidth(int nAirBrushWidth); void SetAirBrushRadius(INT nAirBrushRadius);
void MakeAirBrushThickerOrThinner(BOOL bThinner); void MakeAirBrushThickerOrThinner(BOOL bThinner);
int GetRubberRadius() const; int GetRubberRadius() const;