From 602bfd183e0abaee89ee3264253e573a138cbd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Sat, 12 Aug 2017 16:52:35 -0300 Subject: [PATCH] Fix listbox position on UIDropDownList. --HG-- branch : dev --- src/eepp/ui/uidropdownlist.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/eepp/ui/uidropdownlist.cpp b/src/eepp/ui/uidropdownlist.cpp index 834d9369a..0a84b81cf 100644 --- a/src/eepp/ui/uidropdownlist.cpp +++ b/src/eepp/ui/uidropdownlist.cpp @@ -148,6 +148,15 @@ void UIDropDownList::showList() { if ( mStyleConfig.PopUpToMainControl ) { getParent()->controlToWorld( Pos ); Pos = PixelDensity::pxToDpI( Pos ); + } else if ( NULL != mFriendCtrl ) { + Pos = Vector2i( mFriendCtrl->getPosition().x, mFriendCtrl->getPosition().y + mFriendCtrl->getSize().getHeight() ); + } else { + UIControl * ParentLoop = getParent(); + UIControl * rp = getWindowContainer(); + while ( rp != ParentLoop ) { + Pos += ParentLoop->getPosition(); + ParentLoop = ParentLoop->getParent(); + } } Pos.y -= mListBox->getSize().getHeight();