From bfec6546ce28779d3b168132a70e8291104d0604 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 6 Nov 2008 13:57:14 +0000 Subject: [PATCH] From Thomas Wedner, "use osgViewer::CompositeViewer with several views. All views share parts of their scene graphs. Within these common part some nodes have event handlers which use the action adapter argument to the event handler to determinate which view received the event. Here is the problem, osgViewer::CompositeViewer::eventTraversal sets the action adapter field in the EventVisitor always to the last view which received an event, instead of using the view which actually received the event, so determination of the correct view does not work. I looked at the code a bit, and moved the code for setting the action adapter to a IMO better place" --- src/osgViewer/CompositeViewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index 569b11f90..5b64627a0 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -838,6 +838,8 @@ void CompositeViewer::eventTraversal() ++veitr) { View* view = veitr->first; + _eventVisitor->setActionAdapter(view); + if (view->getSceneData()) { for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin(); @@ -877,7 +879,6 @@ void CompositeViewer::eventTraversal() ++veitr) { View* view = veitr->first; - _eventVisitor->setActionAdapter(view); for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin(); itr != veitr->second.end(); @@ -899,7 +900,6 @@ void CompositeViewer::eventTraversal() ++veitr) { View* view = veitr->first; - _eventVisitor->setActionAdapter(view); for(osgGA::EventQueue::Events::iterator itr = veitr->second.begin(); itr != veitr->second.end();