Implement wxWindow::GetDPI() on macOS and iOS
This commit is contained in:
committed by
Vadim Zeitlin
parent
fa58dc2c45
commit
668f0e7c54
@@ -120,6 +120,8 @@ public:
|
|||||||
virtual bool UnregisterHotKey(int hotkeyId) wxOVERRIDE;
|
virtual bool UnregisterHotKey(int hotkeyId) wxOVERRIDE;
|
||||||
#endif // wxUSE_HOTKEY
|
#endif // wxUSE_HOTKEY
|
||||||
|
|
||||||
|
virtual wxSize GetDPI() const wxOVERRIDE;
|
||||||
|
|
||||||
#if wxUSE_DRAG_AND_DROP
|
#if wxUSE_DRAG_AND_DROP
|
||||||
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
|
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
|
||||||
|
|
||||||
|
@@ -2599,6 +2599,19 @@ bool wxWindowMac::OSXHandleKeyEvent( wxKeyEvent& event )
|
|||||||
return handled ;
|
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
|
// wxWidgetImpl
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user