diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-11-11 22:15:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-11-11 22:17:10 +0100 |
| commit | 5246249a23b244fc85f45f686abb4922122a1e41 (patch) | |
| tree | 5d7934c84f2f50981aed71252c4f8c7d8043a685 /src/wx/gl_video_view.cc | |
| parent | 10efba9f8bab64be330908db01e225e4b7b6836d (diff) | |
Account for DPI scale factors when calculating some sizes (#2118).carsten-player-debug
Diffstat (limited to 'src/wx/gl_video_view.cc')
| -rw-r--r-- | src/wx/gl_video_view.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index bbdb0c727..654c35e7c 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -104,13 +104,15 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent) void GLVideoView::size_changed (wxSizeEvent const& ev) { - _canvas_size = ev.GetSize (); - LOG_GENERAL("GLVideoView canvas size changed to %1x%2", ev.GetSize().GetWidth(), ev.GetSize().GetHeight()); + auto const scale = _canvas->GetDPIScaleFactor(); + int const width = std::round(ev.GetSize().GetWidth() * scale); + int const height = std::round(ev.GetSize().GetHeight() * scale); + _canvas_size = { width, height }; + LOG_GENERAL("GLVideoView canvas size changed to %1x%2", width, height); Sized (); } - GLVideoView::~GLVideoView () { boost::this_thread::disable_interruption dis; |
