1
0
Fork 0

Canvas GUI: check for window on handling mouse events.

This commit is contained in:
Thomas Geymayer 2013-07-25 01:14:23 +02:00
parent a75b9e5de9
commit c3a87f75cd

View file

@ -318,12 +318,12 @@ bool DesktopGroup::handleMouse(const osgGA::GUIEventAdapter& ea)
assert(element->getUserData());
canvas::WindowPtr window =
boost::static_pointer_cast<canvas::Window>
boost::dynamic_pointer_cast<canvas::Window>
(
static_cast<sc::Element::OSGUserData*>(element->getUserData())->element
);
if( !window->isCapturingEvents() || !window->isVisible() )
if( !window || !window->isCapturingEvents() || !window->isVisible() )
continue;
float margin = window->isResizable() ? resize_margin_pos : 0;