Primitive auto-crop (#1477).
[dcpomatic.git] / src / wx / simple_video_view.cc
index 46854653485e5b6643a85ad056f60ff64d5e6012..f866bd4a895a6789df53f5ba4d4da1bb04a3ac4e 100644 (file)
@@ -119,6 +119,19 @@ SimpleVideoView::paint ()
                dc.DrawRectangle (subs->x * out_size.width, subs->y * out_size.height, subs->width * out_size.width, subs->height * out_size.height);
        }
 
+       if (_viewer->crop_guess()) {
+               wxPen p (crop_guess_colour(), 2);
+               dc.SetPen (p);
+               dc.SetBrush (*wxTRANSPARENT_BRUSH);
+               auto const crop_guess = _viewer->crop_guess().get();
+               dc.DrawRectangle (
+                       _inter_position.x + _inter_size.width * crop_guess.x,
+                       _inter_position.y + _inter_size.height * crop_guess.y,
+                       _inter_size.width * crop_guess.width,
+                       _inter_size.height * crop_guess.height
+                       );
+       }
+
         _state_timer.unset();
 }