Bug 400999, gap in tree lines, fix by including the border and padding for primary cells in the clip area, r+sr=neil,a=beltzner
authorenndeakin@sympatico.ca
Tue, 13 Nov 2007 04:37:01 -0800
changeset 7951 740a8fba94ae68a35d1989de3dac5de32203b04a
parent 7950 641b7b25bbe5bb2988668c97d0c0df3380742881
child 7952 89ea5a1ce0a5c8cd6443018b65b1d688f9be8759
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbeltzner
bugs400999
milestone1.9b2pre
Bug 400999, gap in tree lines, fix by including the border and padding for primary cells in the clip area, r+sr=neil,a=beltzner
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -2882,16 +2882,17 @@ nsTreeBodyFrame::PaintRow(PRInt32       
     dirty.IntersectRect(rowRect, aDirtyRect);
     theme->DrawWidgetBackground(&aRenderingContext, this, 
                                 displayData->mAppearance, rowRect, dirty);
   } else {
     PaintBackgroundLayer(rowContext, aPresContext, aRenderingContext, rowRect, aDirtyRect);
   }
   
   // Adjust the rect for its border and padding.
+  nsRect originalRowRect = rowRect;
   AdjustForBorderPadding(rowContext, rowRect);
 
   PRBool isSeparator = PR_FALSE;
   mView->IsSeparator(aRowIndex, &isSeparator);
   if (isSeparator) {
     // The row is a separator.
 
     nscoord primaryX = rowRect.x;
@@ -2903,17 +2904,19 @@ nsTreeBodyFrame::PaintRow(PRInt32       
       if (NS_FAILED(rv)) {
         NS_NOTREACHED("primary column is invalid");
         return;
       }
 
       if (OffsetForHorzScroll(cellRect, PR_FALSE)) {
         cellRect.x += aPt.x;
         nsRect dirtyRect;
-        if (dirtyRect.IntersectRect(aDirtyRect, cellRect))
+        nsRect checkRect(cellRect.x, originalRowRect.y,
+                         cellRect.width, originalRowRect.height);
+        if (dirtyRect.IntersectRect(aDirtyRect, checkRect))
           PaintCell(aRowIndex, primaryCol, cellRect, aPresContext,
                     aRenderingContext, aDirtyRect, primaryX, aPt);
       }
 
       // Paint the left side of the separator.
       nscoord currX;
       nsTreeColumn* previousCol = primaryCol->GetPrevious();
       if (previousCol) {
@@ -2956,20 +2959,27 @@ nsTreeBodyFrame::PaintRow(PRInt32       
       nsRect cellRect;
       rv = currCol->GetRect(this, rowRect.y, rowRect.height, &cellRect);
       // Don't paint cells in hidden columns.
       if (NS_FAILED(rv) || cellRect.width == 0)
         continue;
 
       if (OffsetForHorzScroll(cellRect, PR_FALSE)) {
         cellRect.x += aPt.x;
-        
+
+        // for primary columns, use the row's vertical size so that the
+        // lines get drawn properly
+        nsRect checkRect = cellRect;
+        if (currCol->IsPrimary())
+          checkRect = nsRect(cellRect.x, originalRowRect.y,
+                             cellRect.width, originalRowRect.height);
+
         nsRect dirtyRect;
         nscoord dummy;
-        if (dirtyRect.IntersectRect(aDirtyRect, cellRect))
+        if (dirtyRect.IntersectRect(aDirtyRect, checkRect))
           PaintCell(aRowIndex, currCol, cellRect, aPresContext,
                     aRenderingContext, aDirtyRect, dummy, aPt);
       }
     }
   }
 }
 
 void