Implement wxWindow::GetDPI() on macOS and iOS
This commit is contained in:
parent
fa58dc2c45
commit
668f0e7c54
2 changed files with 15 additions and 0 deletions
|
|
@ -120,6 +120,8 @@ public:
|
|||
virtual bool UnregisterHotKey(int hotkeyId) wxOVERRIDE;
|
||||
#endif // wxUSE_HOTKEY
|
||||
|
||||
virtual wxSize GetDPI() const wxOVERRIDE;
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
|
||||
|
||||
|
|
|
|||
|
|
@ -2599,6 +2599,19 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
|
|||
return handled ;
|
||||
}
|
||||
|
||||
wxSize wxWindowMac::GetDPI() const
|
||||
{
|
||||
wxNonOwnedWindow* tlw = MacGetTopLevelWindow() ;
|
||||
|
||||
double scaleFactor;
|
||||
if ( tlw )
|
||||
scaleFactor = tlw->GetContentScaleFactor();
|
||||
else
|
||||
scaleFactor = wxOSXGetMainScreenContentScaleFactor();
|
||||
|
||||
return wxSize(wxRound(scaleFactor*72.0),wxRound(scaleFactor*72.0));
|
||||
}
|
||||
|
||||
//
|
||||
// wxWidgetImpl
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue