Crash fix when scrolling a listbox.

--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2019-01-17 02:28:26 -03:00
parent 388bcdfbc9
commit 98b9467c4d
2 changed files with 8 additions and 3 deletions

View File

@@ -107,8 +107,10 @@ void EventDispatcher::update( const Time& time ) {
Node * lastFocusControl = mFocusControl;
if ( NULL != mOverControl ) {
mOverControl->onMouseUp( mMousePosi, mInput->getReleaseTrigger() );
sendMsg( mOverControl, NodeMessage::MouseUp, mInput->getReleaseTrigger() );
getOverControl()->onMouseUp( mMousePosi, mInput->getReleaseTrigger() );
if ( NULL != getOverControl() )
sendMsg( getOverControl(), NodeMessage::MouseUp, mInput->getReleaseTrigger() );
}
if ( mInput->getClickTrigger() ) {

View File

@@ -43,15 +43,18 @@ void UIListBoxItem::setTheme( UITheme * Theme ) {
}
Uint32 UIListBoxItem::onMouseUp( const Vector2i& Pos, const Uint32 Flags ) {
UITextView::onMouseUp( Pos, Flags );
if ( mEnabled && mVisible ) {
UIListBox * LBParent = reinterpret_cast<UIListBox*> ( getParent()->getParent() );
if ( Flags & EE_BUTTONS_WUWD && LBParent->getVerticalScrollBar()->isVisible() ) {
// Manage click can delete _this_
LBParent->getVerticalScrollBar()->getSlider()->manageClick( Flags );
}
}
return UITextView::onMouseUp( Pos, Flags );
return 1;
}
Uint32 UIListBoxItem::onMouseClick( const Vector2i& Pos, const Uint32 Flags ) {