                     typicalCellWidths.length = _columnCount;
                     typicalCellHeights.length = _columnCount;
                 }
-
             }
         }
+        
+        // clear cache
+        recentNode = null;
+        recentNode2 = null;
     }
 
     //----------------------------------
     //  rowGap
     //----------------------------------
+
+    private var _rowGap:Number = 0;
     
     /**
      *  The gap between rows.
      * 
      *  @default 0 
      */
-    public var rowGap:Number = 0;
+    public function get rowGap():Number
+    {
+        return _rowGap;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set rowGap(value:Number):void
+    {
+        if (value == _rowGap)
+            return;
+        
+        _rowGap = value;
+        
+        // reset recent node.
+        recentNode = null;
+        recentNode2 = null;
+    }
     
     //----------------------------------
     //  columnGap
     //----------------------------------
-    
-    /**
-     *  The gap between columns. 
-     *      
+
+    private var _columnGap:Number = 0;
+    
+    /**
+     *  The gap between columns.
+     * 
      *  @default 0 
      */
-    public var columnGap:Number = 0;
+    public function get columnGap():Number
+    {
+        return _columnGap;
+    }
+    
+    /**
+     *  @private
+     */
+    public function set columnGap(value:Number):void
+    {
+        if (value == _columnGap)
+            return;
+        
+        _columnGap = value;
+        
+        // reset recent node.
+        recentNode = null;
+        recentNode2 = null;
+    }
     
     //----------------------------------
     //  defaultRowHeight

            
            // subtract previous node's height and its gap.
            indDiff = node.rowIndex - prevNode.rowIndex - 1;
            nodeY = currentY = currentY - indDiff * (defaultRowHeight + rowGap) - (prevNode.maxCellHeight + rowGap); 
            node = prevNode;
        }


            
            // add next node's maxCellHeight and rowGap
            indDiff = nextNode.rowIndex - node.rowIndex - 1;
            currentY = currentY + indDiff * (defaultRowHeight + rowGap);
            nodeY = currentY; 
            node = nextNode;
        }
        
