FIX: wxDisplay crash on wxNOT_FOUND

Change-Id: If7b936d361873e20fb71b7fc35c9d270cd39a763
This commit is contained in:
chunmao.guo 2022-08-12 13:11:03 +08:00 committed by Lane.Wei
parent d4ddd8f470
commit af54a34567
5 changed files with 8 additions and 8 deletions

View file

@ -354,7 +354,7 @@ void DropDown::autoPosition()
}
if (GetPosition().y > pos.y) {
// may exceed
auto drect = wxDisplay(wxDisplay::GetFromWindow(GetParent())).GetGeometry();
auto drect = wxDisplay(GetParent()).GetGeometry();
if (GetPosition().y + size.y + 10 > drect.GetBottom()) {
if (use_content_width && texts.size() <= 15) size.x += 6;
size.y = drect.GetBottom() - GetPosition().y - 10;