Bug 332283, drop indicator not working for trees, r=sr=roc
authorenndeakin@sympatico.ca
Wed, 30 May 2007 16:09:56 -0700
changeset 2017 25d3fa56595bc015958553265ab164399469b93d
parent 2016 5f020afcbfad0dad06957f525c679a466e0eebb3
child 2018 dad6502c8a87be6d6fe4e3e625b1e2659a0b7d27
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)
reviewerssr
bugs332283
milestone1.9a5pre
Bug 332283, drop indicator not working for trees, r=sr=roc
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.h
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -2756,17 +2756,17 @@ nsTreeBodyFrame::PaintTreeBody(nsIRender
     nscoord yPos = mInnerBox.y + mRowHeight * (mSlots->mDropRow - mTopRowIndex) - mRowHeight / 2;
     nsRect feedbackRect(mInnerBox.x, yPos, mInnerBox.width, mRowHeight);
     if (mSlots->mDropOrient == nsITreeView::DROP_AFTER)
       feedbackRect.y += mRowHeight;
 
     nsRect dirtyRect;
     feedbackRect += aPt;
     if (dirtyRect.IntersectRect(aDirtyRect, feedbackRect)) {
-      PaintDropFeedback(feedbackRect, PresContext(), aRenderingContext, aDirtyRect);
+      PaintDropFeedback(feedbackRect, PresContext(), aRenderingContext, aDirtyRect, aPt);
     }
   }
   aRenderingContext.PopState();
 }
 
 
 
 void
@@ -3593,30 +3593,31 @@ nsTreeBodyFrame::PaintProgressMeter(PRIn
   }
 }
 
 
 void
 nsTreeBodyFrame::PaintDropFeedback(const nsRect&        aDropFeedbackRect,
                                    nsPresContext*      aPresContext,
                                    nsIRenderingContext& aRenderingContext,
-                                   const nsRect&        aDirtyRect)
+                                   const nsRect&        aDirtyRect,
+                                   nsPoint              aPt)
 {
   // Paint the drop feedback in between rows.
 
   nscoord currX;
 
   // Adjust for the primary cell.
   nsTreeColumn* primaryCol = mColumns->GetPrimaryColumn();
 
   if (primaryCol) {
     nsresult rv = primaryCol->GetXInTwips(this, &currX);
     NS_ASSERTION(NS_SUCCEEDED(rv), "primary column is invalid?");
 
-    currX -= mHorzPosition;
+    currX += aPt.x - mHorzPosition;
   } else {
     currX = aDropFeedbackRect.x;
   }
 
   PrefillPropertyArray(mSlots->mDropRow, primaryCol);
 
   // Resolve the style to use for the drop feedback.
   nsStyleContext* feedbackContext = GetPseudoStyleContext(nsCSSAnonBoxes::moztreedropfeedback);
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
@@ -211,17 +211,18 @@ protected:
                           nsPresContext*      aPresContext,
                           nsIRenderingContext& aRenderingContext,
                           const nsRect&        aDirtyRect);
 
   // This method paints a drop feedback of the tree.
   void PaintDropFeedback(const nsRect&        aDropFeedbackRect, 
                          nsPresContext*      aPresContext,
                          nsIRenderingContext& aRenderingContext,
-                         const nsRect&        aDirtyRect);
+                         const nsRect&        aDirtyRect,
+                         nsPoint              aPt);
 
   // This method is called with a specific style context and rect to
   // paint the background rect as if it were a full-blown frame.
   void PaintBackgroundLayer(nsStyleContext*      aStyleContext,
                             nsPresContext*      aPresContext, 
                             nsIRenderingContext& aRenderingContext, 
                             const nsRect&        aRect,
                             const nsRect&        aDirtyRect);