diff --git a/toonz/sources/tnztools/toonzrasterbrushtool.cpp b/toonz/sources/tnztools/toonzrasterbrushtool.cpp
index 3ce5708..563b59b 100644
--- a/toonz/sources/tnztools/toonzrasterbrushtool.cpp
+++ b/toonz/sources/tnztools/toonzrasterbrushtool.cpp
@@ -450,27 +450,27 @@ public:
       , m_points(points)
       , m_styleId(styleId)
       , m_selective(selective)
+      , m_isPaletteOrder(isPaletteOrder)
       , m_isPencil(isPencil)
       , m_isStraight(isStraight)
-      , m_isPaletteOrder(isPaletteOrder)
       , m_modifierLockAlpha(lockAlpha) {}
 
   void redo() const override {
     insertLevelAndFrameIfNeeded();
     TToonzImageP image = getImage();
     TRasterCM32P ras   = image->getRaster();
-    RasterStrokeGenerator m_rasterTrack(
+    RasterStrokeGenerator rasterTrack(
         ras, BRUSH, NONE, m_styleId, m_points[0], m_selective, 0,
         m_modifierLockAlpha, !m_isPencil, m_isPaletteOrder);
     if (m_isPaletteOrder) {
       QSet<int> aboveStyleIds;
       getAboveStyleIdSet(m_styleId, image->getPalette(), aboveStyleIds);
-      m_rasterTrack.setAboveStyleIds(aboveStyleIds);
+      rasterTrack.setAboveStyleIds(aboveStyleIds);
     }
-    m_rasterTrack.setPointsSequence(m_points);
-    m_rasterTrack.generateStroke(m_isPencil, m_isStraight);
+    rasterTrack.setPointsSequence(m_points);
+    rasterTrack.generateStroke(m_isPencil, m_isStraight);
     image->setSavebox(image->getSavebox() +
-                      m_rasterTrack.getBBox(m_rasterTrack.getPointsSequence()));
+                      rasterTrack.getBBox(rasterTrack.getPointsSequence()));
     ToolUtils::updateSaveBox();
     TTool::getApplication()->getCurrentXsheet()->notifyXsheetChanged();
     notifyImageChanged();
@@ -506,8 +506,8 @@ public:
       , m_styleId(styleId)
       , m_drawOrder(drawOrder)
       , m_maxThick(maxThick)
-      , m_isStraight(isStraight)
       , m_hardness(hardness)
+      , m_isStraight(isStraight)
       , m_modifierLockAlpha(lockAlpha) {}
 
   void redo() const override {
@@ -879,7 +879,6 @@ ToonzRasterBrushTool::ToonzRasterBrushTool(std::string name, int targetType)
     , m_pressure("Pressure", true)
     , m_modifierSize("ModifierSize", -3, 3, 0, true)
     , m_modifierLockAlpha("Lock Alpha", false)
-    , m_rasterTrack(0)
     , m_targetType(targetType)
     , m_bluredBrush(0)
     , m_enabled(false)
@@ -1368,22 +1367,20 @@ void ToonzRasterBrushTool::leftButtonDown(const TPointD &pos,
 
       TThickPoint thickPoint(centeredPos + convert(ras->getCenter()),
                              thickness);
-      m_rasterTrack = new RasterStrokeGenerator(
+      m_painting.pencil.rasterTrack = new RasterStrokeGenerator(
           ras, BRUSH, NONE, m_painting.styleId, thickPoint, drawOrder != OverAll, 0,
           m_modifierLockAlpha.getValue(), !m_pencil.getValue(),
           drawOrder == PaletteOrder);
 
       if (drawOrder == PaletteOrder)
-        m_rasterTrack->setAboveStyleIds(aboveStyleIds);
+        m_painting.pencil.rasterTrack->setAboveStyleIds(aboveStyleIds);
 
-      m_painting.tileSaver->save(m_rasterTrack->getLastRect());
+      m_painting.tileSaver->save( m_painting.pencil.rasterTrack->getLastRect() );
       if (!m_painting.straight.isStraight)
-        m_rasterTrack->generateLastPieceOfStroke(m_pencil.getValue());
+        m_painting.pencil.rasterTrack->generateLastPieceOfStroke( m_pencil.getValue() );
 
-      std::vector<TThickPoint> pts;
-      if (m_smooth.getValue() == 0) {
-        pts.push_back(thickPoint);
-      } else {
+      if (m_smooth.getValue()) {
+        std::vector<TThickPoint> pts;
         m_smoothStroke.beginStroke(m_smooth.getValue());
         m_smoothStroke.addPoint(thickPoint);
         m_smoothStroke.getSmoothPoints(pts);
@@ -1513,7 +1510,7 @@ void ToonzRasterBrushTool::leftButtonDrag(const TPointD &pos,
         TRectD(centeredPos - thickOffset, centeredPos + thickOffset);
     invalidateRect +=
         TRectD(m_brushPos - thickOffset, m_brushPos + thickOffset);
-  } else if (m_rasterTrack &&
+  } else if (m_painting.pencil.rasterTrack &&
              (m_hardness.getValue() == 100 || m_pencil.getValue())) {
     /*-- Pencilモードでなく、Hardness=100 の場合のブラシサイズを1段階下げる
      * --*/
@@ -1529,10 +1526,10 @@ void ToonzRasterBrushTool::leftButtonDrag(const TPointD &pos,
     }
     for (size_t i = 0; i < pts.size(); ++i) {
       const TThickPoint &thickPoint = pts[i];
-      m_rasterTrack->add(thickPoint);
-      m_painting.tileSaver->save(m_rasterTrack->getLastRect());
-      m_rasterTrack->generateLastPieceOfStroke(m_pencil.getValue());
-      std::vector<TThickPoint> brushPoints = m_rasterTrack->getPointsSequence();
+      m_painting.pencil.rasterTrack->add( thickPoint);
+      m_painting.tileSaver->save( m_painting.pencil.rasterTrack->getLastRect() );
+      m_painting.pencil.rasterTrack->generateLastPieceOfStroke( m_pencil.getValue() );
+      std::vector<TThickPoint> brushPoints = m_painting.pencil.rasterTrack->getPointsSequence();
       int m                                = (int)brushPoints.size();
       std::vector<TThickPoint> points;
       if (m == 3) {
@@ -1693,7 +1690,7 @@ void ToonzRasterBrushTool::finishRasterBrush(const TPointD &pos,
           m_isLevelCreated, subras, m_painting.myPaint.strokeRect.getP00()));
     }
 
-  } else if (m_rasterTrack &&
+  } else if (m_painting.pencil.rasterTrack &&
              (m_hardness.getValue() == 100 || m_pencil.getValue())) {
     double thickness = m_pressure.getValue()
                            ? computeThickness(pressureVal, m_rasThickness) * 2
@@ -1720,12 +1717,12 @@ void ToonzRasterBrushTool::finishRasterBrush(const TPointD &pos,
     }
     for (size_t i = 0; i < pts.size(); ++i) {
       const TThickPoint &thickPoint = pts[i];
-      m_rasterTrack->add(thickPoint);
-      m_painting.tileSaver->save(m_rasterTrack->getLastRect(m_painting.straight.isStraight));
-      m_rasterTrack->generateLastPieceOfStroke(m_pencil.getValue(), true,
+      m_painting.pencil.rasterTrack->add( thickPoint );
+      m_painting.tileSaver->save( m_painting.pencil.rasterTrack->getLastRect( m_painting.straight.isStraight) );
+      m_painting.pencil.rasterTrack->generateLastPieceOfStroke(m_pencil.getValue(), true,
                                                m_painting.straight.isStraight);
 
-      std::vector<TThickPoint> brushPoints = m_rasterTrack->getPointsSequence();
+      std::vector<TThickPoint> brushPoints = m_painting.pencil.rasterTrack->getPointsSequence();
       int m                                = (int)brushPoints.size();
       std::vector<TThickPoint> points;
       if (m_painting.straight.isStraight) {
@@ -1746,14 +1743,14 @@ void ToonzRasterBrushTool::finishRasterBrush(const TPointD &pos,
 
     if (m_painting.tileSet->getTileCount() > 0) {
       TUndoManager::manager()->add(new RasterBrushUndo(
-          m_painting.tileSet, m_rasterTrack->getPointsSequence(),
-          m_rasterTrack->getStyleId(), m_rasterTrack->isSelective(),
+          m_painting.tileSet, m_painting.pencil.rasterTrack->getPointsSequence(),
+          m_painting.pencil.rasterTrack->getStyleId(), m_painting.pencil.rasterTrack->isSelective(),
           simLevel.getPointer(), frameId, m_pencil.getValue(), m_isFrameCreated,
-          m_isLevelCreated, m_rasterTrack->isPaletteOrder(),
-          m_rasterTrack->isAlphaLocked(), m_painting.straight.isStraight));
+          m_isLevelCreated, m_painting.pencil.rasterTrack->isPaletteOrder(),
+          m_painting.pencil.rasterTrack->isAlphaLocked(), m_painting.straight.isStraight));
     }
-    delete m_rasterTrack;
-    m_rasterTrack = 0;
+    delete m_painting.pencil.rasterTrack;
+    m_painting.pencil.rasterTrack = nullptr;
   } else {
     double maxThickness = m_rasThickness.getValue().second;
     double thickness    = (m_pressure.getValue())
diff --git a/toonz/sources/tnztools/toonzrasterbrushtool.h b/toonz/sources/tnztools/toonzrasterbrushtool.h
index 7db0c83..01c5685 100644
--- a/toonz/sources/tnztools/toonzrasterbrushtool.h
+++ b/toonz/sources/tnztools/toonzrasterbrushtool.h
@@ -186,6 +186,10 @@ protected:
     TTileSaverCM32 *tileSaver = nullptr;
     TRect lastRect;
     
+    struct Pencil {
+      RasterStrokeGenerator *rasterTrack = nullptr;
+    } pencil;
+    
     struct MyPaint {
       MyPaintToonzBrush *brush = nullptr;
       TRect strokeRect;
@@ -213,7 +217,6 @@ protected:
   TDoubleProperty m_modifierSize;
   TBoolProperty m_modifierLockAlpha;
 
-  RasterStrokeGenerator *m_rasterTrack;
   double m_minThick, m_maxThick;
 
   int m_targetType;