https://git.reactos.org/?p=reactos.git;a=commitdiff;h=945ee4b2a47402e99beb8a8e877c32e6cf81bbcd

commit 945ee4b2a47402e99beb8a8e877c32e6cf81bbcd
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Thu Sep 28 21:54:32 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Thu Sep 28 21:54:32 2023 +0900

    [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
---
 base/applications/mspaint/mouse.cpp      | 10 ++++++++++
 base/applications/mspaint/toolsmodel.cpp | 12 ++++++++++++
 base/applications/mspaint/toolsmodel.h   |  2 ++
 3 files changed, 24 insertions(+)

diff --git a/base/applications/mspaint/mouse.cpp 
b/base/applications/mspaint/mouse.cpp
index fc4b1792bec..793efedf3ec 100644
--- a/base/applications/mspaint/mouse.cpp
+++ b/base/applications/mspaint/mouse.cpp
@@ -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
diff --git a/base/applications/mspaint/toolsmodel.cpp 
b/base/applications/mspaint/toolsmodel.cpp
index 07ded56ea99..dec101adc9e 100644
--- a/base/applications/mspaint/toolsmodel.cpp
+++ b/base/applications/mspaint/toolsmodel.cpp
@@ -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;
diff --git a/base/applications/mspaint/toolsmodel.h 
b/base/applications/mspaint/toolsmodel.h
index b6f2c96fbdb..d90faee117b 100644
--- a/base/applications/mspaint/toolsmodel.h
+++ b/base/applications/mspaint/toolsmodel.h
@@ -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);

Reply via email to