Use the new wxDisplay(wxWindow*) ctor to simplify the code
Make the code simpler and, in a couple of places where the fall back to the primary display in case wxDisplay::GetFromWindow() returned -1 was missing, also more correct.
This commit is contained in:
@@ -1861,8 +1861,7 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
|
||||
position.x = wxRound(position.x + rc.left);
|
||||
position.y = wxRound(position.y + rc.top);
|
||||
|
||||
const int currentDisplay = wxDisplay::GetFromWindow(relativeWin);
|
||||
const wxRect displayRect = wxDisplay(currentDisplay).GetClientArea();
|
||||
const wxRect displayRect = wxDisplay(relativeWin).GetClientArea();
|
||||
|
||||
if (position.x < displayRect.GetLeft())
|
||||
position.x = displayRect.GetLeft();
|
||||
|
Reference in New Issue
Block a user