1
0
Fork 0

Canvas window: Update for SimGear MouseEvent changes.

This commit is contained in:
Thomas Geymayer 2013-05-13 00:37:13 +02:00
parent 32834eb0b0
commit 351f1f4565
2 changed files with 2 additions and 13 deletions

View file

@ -308,7 +308,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
_last_x = event->getScreenX(); _last_x = event->getScreenX();
_last_y = event->getScreenY(); _last_y = event->getScreenY();
event->client_pos = event->screen_pos; event->local_pos = event->client_pos = event->screen_pos;
if( !_resize_window.expired() ) if( !_resize_window.expired() )
{ {
@ -454,11 +454,6 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
sc::MouseEventPtr move_event( new sc::MouseEvent(*event) ); sc::MouseEventPtr move_event( new sc::MouseEvent(*event) );
move_event->type = sc::Event::MOUSE_LEAVE; move_event->type = sc::Event::MOUSE_LEAVE;
// Let the event position be always relative to the top left window
// corner
move_event->client_pos.x() -= last_mouse_over->getRegion().x();
move_event->client_pos.y() -= last_mouse_over->getRegion().y();
last_mouse_over->handleMouseEvent(move_event); last_mouse_over->handleMouseEvent(move_event);
} }
_last_mouse_over = window_at_cursor; _last_mouse_over = window_at_cursor;
@ -481,13 +476,7 @@ bool GUIMgr::handleMouse(const osgGA::GUIEventAdapter& ea)
} }
if( target_window ) if( target_window )
{
// Let the event position be always relative to the top left window corner
event->client_pos.x() -= target_window->getRegion().x();
event->client_pos.y() -= target_window->getRegion().y();
return target_window->handleMouseEvent(event); return target_window->handleMouseEvent(event);
}
else else
return false; return false;
} }

View file

@ -130,7 +130,7 @@ namespace canvas
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool Window::handleMouseEvent(const simgear::canvas::MouseEventPtr& event) bool Window::handleMouseEvent(const simgear::canvas::MouseEventPtr& event)
{ {
return _image.handleMouseEvent(event); return _image.handleEvent(event);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------