summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2011-09-12 23:06:43 -0400
committerNat Goodspeed <nat@lindenlab.com>2011-09-12 23:06:43 -0400
commit993dff2ea01c7b11ea7cfc0bffa66adac2a70f82 (patch)
treeb9cc057c3ea553c6c26ba2598f3a3f68cfff4b92
parent2d19a2002501d44ce18080b6f26ceaf2dbf796e9 (diff)
Fix new LLView::childFromPoint(recur=true) behavior: was always NULL.
The recursive logic always used to recur to the point where there were no children -- where the next level of recursion returned NULL -- and then return that NULL. Fix so when that lowest-level call returns NULL, we return one level above that.
-rw-r--r--indra/llui/llview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e2b9527cc5..f457ff1052 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -843,7 +843,12 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur)
// top-level child?
if (recur)
{
- return viewp->childFromPoint(local_x, local_y, recur);
+ LLView* leaf(viewp->childFromPoint(local_x, local_y, recur));
+ // Maybe viewp is already a leaf LLView, or maybe it has children
+ // but this particular (x, y) point falls between them. If the
+ // recursive call returns non-NULL, great, use that; else just use
+ // viewp.
+ return leaf? leaf : viewp;
}
return viewp;