https://git.reactos.org/?p=reactos.git;a=commitdiff;h=157739a658ad4c31acb51d...
commit 157739a658ad4c31acb51d65d8040cfe894dc1b3 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Thu Nov 16 15:45:06 2023 +0900 Commit: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com CommitDate: Thu Nov 16 15:45:06 2023 +0900
[MSPAINT] s/AirBrushWidth/AirBrushRadius/
Fix logical error. CORE-19094 --- base/applications/mspaint/mouse.cpp | 2 +- base/applications/mspaint/toolsettings.cpp | 4 ++-- base/applications/mspaint/toolsmodel.cpp | 14 +++++++------- base/applications/mspaint/toolsmodel.h | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index ad709d9c3db..d650259f6cb 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -654,7 +654,7 @@ struct AirBrushTool : SmoothDrawTool void draw(BOOL bLeftButton, LONG x, LONG y) override { 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 diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index e8bd61f1b7e..d1a501728a2 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -219,7 +219,7 @@ VOID CToolSettingsWindow::drawAirBrush(HDC hdc, LPCRECT prc) RECT& rc = rects[i]; INT x = (rc.left + rc.right) / 2; INT y = (rc.top + rc.bottom) / 2; - BOOL bHigh = (s_AirRadius[i] == toolsModel.GetAirBrushWidth()); + BOOL bHigh = (s_AirRadius[i] == toolsModel.GetAirBrushRadius()); if (bHigh) { ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_HIGHLIGHT)); @@ -438,7 +438,7 @@ LRESULT CToolSettingsWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lPar case TOOL_AIRBRUSH: iItem = getAirBrushRects(rects, &rect1, &pt); if (iItem != -1) - toolsModel.SetAirBrushWidth(s_AirRadius[iItem]); + toolsModel.SetAirBrushRadius(s_AirRadius[iItem]); break; case TOOL_LINE: case TOOL_BEZIER: diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index 884b92d7d6c..42ee980c2b3 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -18,7 +18,7 @@ ToolsModel::ToolsModel() m_shapeStyle = 0; m_brushStyle = BrushStyleRound; m_oldActiveTool = m_activeTool = TOOL_PEN; - m_airBrushWidth = 5; + m_airBrushRadius = 5; m_rubberRadius = 4; m_transpBg = FALSE; m_zoom = 1000; @@ -99,8 +99,8 @@ void ToolsModel::MakeBrushThickerOrThinner(BOOL bThinner)
void ToolsModel::MakeAirBrushThickerOrThinner(BOOL bThinner) { - INT thickness = GetAirBrushWidth(); - SetAirBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); + INT thickness = GetAirBrushRadius(); + SetAirBrushRadius(bThinner ? max(1, thickness - 1) : (thickness + 1)); }
void ToolsModel::MakeRubberThickerOrThinner(BOOL bThinner) @@ -180,14 +180,14 @@ void ToolsModel::SetActiveTool(TOOLTYPE nActiveTool) 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(); }
diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index 9af67a501c7..a5737010d9b 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -80,7 +80,7 @@ private: BrushStyle m_brushStyle; TOOLTYPE m_activeTool; TOOLTYPE m_oldActiveTool; - int m_airBrushWidth; + INT m_airBrushRadius; int m_rubberRadius; BOOL m_transpBg; int m_zoom; @@ -116,8 +116,8 @@ public: TOOLTYPE GetOldActiveTool() const; void SetActiveTool(TOOLTYPE nActiveTool);
- int GetAirBrushWidth() const; - void SetAirBrushWidth(int nAirBrushWidth); + INT GetAirBrushRadius() const; + void SetAirBrushRadius(INT nAirBrushRadius); void MakeAirBrushThickerOrThinner(BOOL bThinner);
int GetRubberRadius() const;