Bug 1116952 - Treelines fragments after bug 1105104. r=jwatt, a=lmandel
authorKarsten Düsterloh <mnyromyr@tprac.de>
Wed, 04 Feb 2015 17:55:00 +0100
changeset 250454 5bd29483f85e
parent 250453 9b7aa96d0e11
child 250455 fb9ae74a783a
push id4592
push userryanvm@gmail.com
push date2015-03-19 20:47 +0000
treeherdermozilla-beta@52b55d9c1d61 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, lmandel
bugs1116952, 1105104
milestone37.0
Bug 1116952 - Treelines fragments after bug 1105104. r=jwatt, a=lmandel
layout/xul/tree/nsTreeBodyFrame.cpp
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -3262,28 +3262,30 @@ nsTreeBodyFrame::PaintCell(int32_t      
       }
 
       int32_t currentParent = aRowIndex;
       for (int32_t i = level; i > 0; i--) {
         if (srcX <= cellRect.x + cellRect.width) {
           // Paint full vertical line only if we have next sibling.
           bool hasNextSibling;
           mView->HasNextSibling(currentParent, aRowIndex, &hasNextSibling);
-          Point p1(pc->AppUnitsToGfxUnits(srcX),
-                   pc->AppUnitsToGfxUnits(lineY));
-          Point p2;
-          p2.x = pc->AppUnitsToGfxUnits(srcX);
-
-          if (hasNextSibling)
-            p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight);
-          else if (i == level)
-            p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight / 2);
-
-          SnapLineToDevicePixelsForStroking(p1, p2, *drawTarget);
-          drawTarget->StrokeLine(p1, p2, colorPatt, strokeOptions);
+          if (hasNextSibling || i == level) {
+            Point p1(pc->AppUnitsToGfxUnits(srcX),
+                     pc->AppUnitsToGfxUnits(lineY));
+            Point p2;
+            p2.x = pc->AppUnitsToGfxUnits(srcX);
+
+            if (hasNextSibling)
+              p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight);
+            else if (i == level)
+              p2.y = pc->AppUnitsToGfxUnits(lineY + mRowHeight / 2);
+
+            SnapLineToDevicePixelsForStroking(p1, p2, *drawTarget);
+            drawTarget->StrokeLine(p1, p2, colorPatt, strokeOptions);
+          }          
         }
 
         int32_t parent;
         if (NS_FAILED(mView->GetParentIndex(currentParent, &parent)) || parent < 0)
           break;
         currentParent = parent;
         srcX -= mIndentation;
       }