Fix drawing.
authorCarl Hetherington <cth@carlh.net>
Mon, 2 Jul 2018 21:55:29 +0000 (22:55 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 2 Jul 2018 21:55:29 +0000 (22:55 +0100)
src/wx/timeline.cc
src/wx/timeline_content_view.cc

index 2e4de2274ab2e2658012b4d9dde45c0708e90d4d..30a5ef1724e9be5d23171de0a92f43ac405f847b 100644 (file)
@@ -79,6 +79,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
 
        wxSizer* sizer = new wxBoxSizer (wxHORIZONTAL);
        sizer->Add (_labels_panel, 0, wxEXPAND);
+       _labels_panel->SetMinSize (wxSize (_labels_view->bbox().width, -1));
        sizer->Add (_main_canvas, 1, wxEXPAND);
        SetSizer (sizer);
 
@@ -106,7 +107,7 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film)
 void
 Timeline::paint_labels ()
 {
-       wxPaintDC dc (this);
+       wxPaintDC dc (_labels_panel);
 
        wxGraphicsContext* gc = wxGraphicsContext::Create (dc);
        if (!gc) {
@@ -121,7 +122,7 @@ Timeline::paint_labels ()
 void
 Timeline::paint_main ()
 {
-       wxPaintDC dc (this);
+       wxPaintDC dc (_main_canvas);
        _main_canvas->DoPrepareDC (dc);
 
        wxGraphicsContext* gc = wxGraphicsContext::Create (dc);
index eacfbfd4a0143a493803d8f9a578e6446edac1b8..abb671b770695e217a1c234423317c8730173553 100644 (file)
@@ -117,11 +117,11 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
 
        /* Outline */
        wxGraphicsPath path = gc->CreatePath ();
-       path.MoveToPoint    (time_x (position) + 1,           y_pos (_track.get()) + 4);
+       path.MoveToPoint    (time_x (position) + 2,           y_pos (_track.get()) + 4);
        path.AddLineToPoint (time_x (position + len) - 1,     y_pos (_track.get()) + 4);
        path.AddLineToPoint (time_x (position + len) - 1,     y_pos (_track.get() + 1) - 4);
-       path.AddLineToPoint (time_x (position) + 1,           y_pos (_track.get() + 1) - 4);
-       path.AddLineToPoint (time_x (position) + 1,           y_pos (_track.get()) + 4);
+       path.AddLineToPoint (time_x (position) + 2,           y_pos (_track.get() + 1) - 4);
+       path.AddLineToPoint (time_x (position) + 2,           y_pos (_track.get()) + 4);
        gc->StrokePath (path);
        gc->FillPath (path);