diff --git a/toonz/sources/include/tgeometry.h b/toonz/sources/include/tgeometry.h
index 7654e26..c669869 100644
--- a/toonz/sources/include/tgeometry.h
+++ b/toonz/sources/include/tgeometry.h
@@ -39,10 +39,10 @@ class TPointT {
 public:
   T x, y;
 
-  TPointT() : x(0), y(0){};
-  TPointT(T _x, T _y) : x(_x), y(_y){};
-  TPointT(const TPointT &point) : x(point.x), y(point.y){};
-  explicit TPointT(const TPoint4T<T> &point);
+  inline TPointT() : x(0), y(0){};
+  inline TPointT(T _x, T _y) : x(_x), y(_y){};
+  inline TPointT(const TPointT &point) : x(point.x), y(point.y){};
+  inline explicit TPointT(const TPoint4T<T> &point);
 
   inline TPointT &operator=(const TPointT &a) {
     x = a.x;
@@ -77,11 +77,11 @@ public:
     T a[4];
   };
 
-  TPoint4T():
+  inline TPoint4T():
     x(), y(), z(), w() { };
-  TPoint4T(T x, T y, T z, T w):
+  inline TPoint4T(T x, T y, T z, T w):
     x(x), y(y), z(z), w(w) { };
-  explicit TPoint4T(const TPointT<T> &p, T w = (T)1):
+  inline explicit TPoint4T(const TPointT<T> &p, T w = (T)1):
       x(p.x), y(p.y), z(), w(w) { };
 };
 
@@ -223,7 +223,7 @@ inline double tdistance2(const TPointD &p1, const TPointD &p2) {
 }
 
 inline bool operator==(const TPointD &p0, const TPointD &p1) {
-  return tdistance2(p0, p1) < TConsts::epsilon * TConsts::epsilon;
+  return tdistance2(p0, p1) <= TConsts::epsilon * TConsts::epsilon;
 }
 inline bool operator!=(const TPointD &p0, const TPointD &p1) {
   return !(p0 == p1);
diff --git a/toonz/sources/include/toonz/rasterstrokegenerator.h b/toonz/sources/include/toonz/rasterstrokegenerator.h
index e2c7857..1de01d3 100644
--- a/toonz/sources/include/toonz/rasterstrokegenerator.h
+++ b/toonz/sources/include/toonz/rasterstrokegenerator.h
@@ -70,7 +70,7 @@ public:
   void generateStroke(bool isPencil, bool isStraight = false) const;
 
   // Ritorna m_points
-  std::vector<TThickPoint> getPointsSequence() { return m_points; }
+  const std::vector<TThickPoint>& getPointsSequence() { return m_points; }
   void setPointsSequence(const std::vector<TThickPoint> &points) {
     m_points = points;
   }
diff --git a/toonz/sources/tnztools/toonzrasterbrushtool.cpp b/toonz/sources/tnztools/toonzrasterbrushtool.cpp
index 42d784f..d21e100 100644
--- a/toonz/sources/tnztools/toonzrasterbrushtool.cpp
+++ b/toonz/sources/tnztools/toonzrasterbrushtool.cpp
@@ -1472,11 +1472,7 @@ void ToonzRasterBrushTool::inputPaintTrackPoint(const TTrackPoint &point, const 
     handler->brush.generateLastPieceOfStroke( m_painting.pencil.realPencil );
     
     // determine invalidate rect
-    std::vector<TThickPoint> points = handler->brush.getPointsSequence();
-    int m = (int)points.size() - 3;
-    if (m > 0)
-      points.erase(points.begin(), points.begin() + m);
-    invalidateRect += ToolUtils::getBounds(points, m_rasThickness.getValue().second) - rasCenter;
+    invalidateRect += convert(strokeRect) - rasCenter;
   } else
   if (m_painting.blured.isActive) {
     // blured brush case (aka regular brush)