Basics of timeline track labels.
[dcpomatic.git] / src / wx / timeline_time_axis_view.cc
index bbaf5fde2847422114088407f56d4ef684eb83fb..ce37ec659e3f7561ea85be7fe94d3077d6080de0 100644 (file)
@@ -34,7 +34,7 @@ TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y)
 dcpomatic::Rect<int>
 TimelineTimeAxisView::bbox () const
 {
-       return dcpomatic::Rect<int> (0, _y - 4, _timeline.width(), 24);
+       return dcpomatic::Rect<int> (_timeline.tracks_position().x, _y - 4, _timeline.width(), 24);
 }
 
 void
@@ -74,7 +74,7 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
        }
 
        wxGraphicsPath path = gc->CreatePath ();
-       path.MoveToPoint (_timeline.x_offset(), _y);
+       path.MoveToPoint (_timeline.tracks_position().x, _y);
        path.AddLineToPoint (_timeline.width(), _y);
        gc->StrokePath (path);
 
@@ -102,7 +102,7 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
                wxDouble str_leading;
                gc->GetTextExtent (str, &str_width, &str_height, &str_descent, &str_leading);
 
-               int const tx = _timeline.x_offset() + t.seconds() * pps;
+               int const tx = _timeline.tracks_position().x + t.seconds() * pps;
                if ((tx + str_width) < _timeline.width()) {
                        gc->DrawText (str, time_x (t), _y + 16);
                }