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

@ -141,7 +141,7 @@ bool MarkdownTip::ShowTip(wxPoint pos, std::string const &tip, std::string const
this->Hide();
}
if (_tipView->GetParent() == this) {
wxSize size = wxDisplay(wxDisplay::GetFromWindow(this)).GetClientArea().GetSize();
wxSize size = wxDisplay(this).GetClientArea().GetSize();
_requestPos = pos;
if (pos.y + this->GetSize().y > size.y)
pos.y = size.y - this->GetSize().y;
@ -254,7 +254,7 @@ void MarkdownTip::OnTitleChanged(wxWebViewEvent& event)
return;
_lastHeight = height;
height *= 1.25; height += 50;
wxSize size = wxDisplay(wxDisplay::GetFromWindow(this)).GetClientArea().GetSize();
wxSize size = wxDisplay(this).GetClientArea().GetSize();
if (height > size.y)
height = size.y;
wxPoint pos = _requestPos;