diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-11-20 22:35:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-11-20 22:44:19 +0100 |
| commit | 2d2af972a53a2c11b95469058803b4eaed2d3c01 (patch) | |
| tree | be9b117ded86780e66f5926aa418619a019cdf9a /src/wx/film_viewer.cc | |
| parent | 83e5ff9a10b8f2e44bfc0d25d3f55eb06f3af518 (diff) | |
Extract dpi_scale_factor() to a function.
Diffstat (limited to 'src/wx/film_viewer.cc')
| -rw-r--r-- | src/wx/film_viewer.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 392c68d70..259e2bc16 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -283,13 +283,9 @@ FilmViewer::calculate_sizes () auto const container = _film->container (); -#if wxCHECK_VERSION(3,1,0) - auto const dpi_scale_factor = _video_view->get()->GetDPIScaleFactor(); -#else - auto const dpi_scale_factor = 1; -#endif - int const video_view_width = std::round(_video_view->get()->GetSize().x * dpi_scale_factor); - int const video_view_height = std::round(_video_view->get()->GetSize().y * dpi_scale_factor); + auto const scale = dpi_scale_factor (_video_view->get()); + int const video_view_width = std::round(_video_view->get()->GetSize().x * scale); + int const video_view_height = std::round(_video_view->get()->GetSize().y * scale); auto const view_ratio = float(video_view_width) / video_view_height; auto const film_ratio = container ? container->ratio () : 1.78; |
