diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-11-11 22:15:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-11-14 00:27:31 +0100 |
| commit | 081525ef1c392465fc5a0bb4be79af8e84655bc4 (patch) | |
| tree | 4ac5aae3462f7d55f1df983a7c876fd74bfe48db /src/wx/gl_video_view.cc | |
| parent | e1cbceca253ebf16f49e5bc78e3f1d0157c37bee (diff) | |
Account for DPI scale factors when calculating some sizes (#2118).v2.15.173
Diffstat (limited to 'src/wx/gl_video_view.cc')
| -rw-r--r-- | src/wx/gl_video_view.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index 877cd5125..559cff413 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -103,12 +103,15 @@ GLVideoView::GLVideoView (FilmViewer* viewer, wxWindow *parent) void GLVideoView::size_changed (wxSizeEvent const& ev) { - _canvas_size = ev.GetSize (); + 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; |
