summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprimmediacontrols.cpp
diff options
context:
space:
mode:
authorangela <angela@lindenlab.com>2009-11-05 11:41:07 +0800
committerangela <angela@lindenlab.com>2009-11-05 11:41:07 +0800
commit95738da3d82b92e82744dbc6b377a3feae2e6441 (patch)
treecf1678c617ea644a14d20a40fbfc58f156fd9591 /indra/newview/llpanelprimmediacontrols.cpp
parent35c7c7a9b29ef4462ea969b393c25b59813ef169 (diff)
parentaf401ac6dc463db477210b0ff100014fbeb50a9a (diff)
merge
Diffstat (limited to 'indra/newview/llpanelprimmediacontrols.cpp')
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp33
1 files changed, 20 insertions, 13 deletions
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 58ca481b77..0b2a7e8756 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -691,24 +691,31 @@ bool LLPanelPrimMediaControls::isMouseOver()
getWindow()->getCursorPosition(&cursor_pos_window);
getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl);
- LLPanel* controls_panel = NULL;
- controls_panel = getChild<LLPanel>("media_hover_controls");
- if(controls_panel && !controls_panel->getVisible())
- {
- // The hover controls aren't visible -- use the focused controls instead.
- controls_panel = getChild<LLPanel>("media_focused_controls");
- }
+ LLView* controls_view = NULL;
+ controls_view = getChild<LLView>("media_controls");
- if(controls_panel && controls_panel->getVisible())
+ if(controls_view && controls_view->getVisible())
{
- controls_panel->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y);
+ controls_view->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y);
- LLView *hit_child = controls_panel->childFromPoint(x, y);
- if(hit_child)
+ LLView *hit_child = controls_view->childFromPoint(x, y);
+ if(hit_child && hit_child->getVisible())
{
// This was useful for debugging both coordinate translation and view hieararchy problems...
-// llinfos << "mouse coords: " << x << ", " << y << " hit child " << hit_child->getName() << llendl;
- result = true;
+ // llinfos << "mouse coords: " << x << ", " << y << " hit child " << hit_child->getName() << llendl;
+
+ // This will be a direct child of the LLLayoutStack, which should be a layout_panel.
+ // These may not shown/hidden by the logic in updateShape(), so we need to do another hit test on the children of the layout panel,
+ // which are the actual controls.
+ hit_child->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y);
+
+ LLView *hit_child_2 = hit_child->childFromPoint(x, y);
+ if(hit_child_2 && hit_child_2->getVisible())
+ {
+ // This was useful for debugging both coordinate translation and view hieararchy problems...
+ // llinfos << " mouse coords: " << x << ", " << y << " hit child 2 " << hit_child_2->getName() << llendl;
+ result = true;
+ }
}
}
}