X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Ffilm_viewer.cc;h=a93b4226e97084f228b104d5957e8351c0b5e7d7;hb=f22d1efccfda7ea8694e3e4c40f319b065a59788;hp=e678c6aa3045cc9057d29c77ecd6cafbe2f69cbe;hpb=4d0356840c2f400b0376230a3d07f57897275f99;p=dcpomatic.git diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index e678c6aa3..a93b4226e 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -283,17 +283,21 @@ FilmViewer::calculate_sizes () auto const container = _film->container (); - auto const view_ratio = float(_video_view->get()->GetSize().x) / _video_view->get()->GetSize().y; + auto const dpi_scale_factor = _video_view->get()->GetDPIScaleFactor(); + 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 view_ratio = float(video_view_width) / video_view_height; auto const film_ratio = container ? container->ratio () : 1.78; dcp::Size out_size; if (view_ratio < film_ratio) { /* panel is less widscreen than the film; clamp width */ - out_size.width = _video_view->get()->GetSize().x; + out_size.width = video_view_width; out_size.height = lrintf (out_size.width / film_ratio); } else { /* panel is more widescreen than the film; clamp height */ - out_size.height = _video_view->get()->GetSize().y; + out_size.height = video_view_height; out_size.width = lrintf (out_size.height * film_ratio); } @@ -371,7 +375,7 @@ FilmViewer::start () /* Calling start() below may directly result in Stopped being emitted, and if that * happens we want it to come after the Started signal, so do that first. */ - Started (position()); + Started (); _video_view->start (); } @@ -390,7 +394,7 @@ FilmViewer::stop () _playing = false; _video_view->stop (); - Stopped (position()); + Stopped (); _video_view->rethrow (); return true;