Fix colour of preview when there is no film loaded.
authorCarl Hetherington <cth@carlh.net>
Mon, 2 May 2022 21:13:55 +0000 (23:13 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 2 May 2022 21:13:55 +0000 (23:13 +0200)
src/wx/simple_video_view.cc

index f866bd4a895a6789df53f5ba4d4da1bb04a3ac4e..00d81ab47a4d89f89e552b55ab017348e7220363 100644 (file)
@@ -72,9 +72,12 @@ SimpleVideoView::paint ()
        dc.SetLogicalScale (scale, scale);
 
        auto const panel_size = _panel->GetSize ();
+       auto pad = pad_colour();
 
        dcp::Size out_size;
        if (!_image) {
+               wxBrush b (pad);
+               dc.SetBackground (b);
                dc.Clear ();
        } else {
                DCPOMATIC_ASSERT (_image->alignment() == Image::Alignment::COMPACT);
@@ -84,8 +87,6 @@ SimpleVideoView::paint ()
                dc.DrawBitmap (frame_bitmap, 0, max(0, (panel_size.GetHeight() - out_size.height) / 2));
        }
 
-       auto pad = pad_colour();
-
        if (out_size.width < panel_size.GetWidth()) {
                wxPen   p (pad);
                wxBrush b (pad);