Make the timeline look better when there is no content in the film.
authorCarl Hetherington <cth@carlh.net>
Sun, 5 Feb 2023 12:57:12 +0000 (13:57 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 5 Feb 2023 12:57:12 +0000 (13:57 +0100)
src/wx/timeline.cc

index d2443c8a974690c1b8b57163dde2bddecafaca56..0d7ae7afbca803a0976857645cf09c863f7f5fd9 100644 (file)
@@ -151,6 +151,11 @@ Timeline::paint_labels ()
 {
        wxPaintDC dc (_labels_canvas);
 
+       auto film = _film.lock();
+       if (film->content().empty()) {
+               return;
+       }
+
        auto gc = wxGraphicsContext::Create (dc);
        if (!gc) {
                return;
@@ -170,6 +175,12 @@ void
 Timeline::paint_main ()
 {
        wxPaintDC dc (_main_canvas);
+
+       auto film = _film.lock();
+       if (film->content().empty()) {
+               return;
+       }
+
        _main_canvas->DoPrepareDC (dc);
 
        auto gc = wxGraphicsContext::Create (dc);