int vsx, vsy;
_labels_canvas->GetViewStart (&vsx, &vsy);
- gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate);
+ gc->Translate (-vsx * _x_scroll_rate, -vsy * _y_scroll_rate + tracks_y_offset());
_labels_view->paint (gc, list<dcpomatic::Rect<int> >());
_labels_view->set_subtitle_tracks (subtitle_tracks);
_labels_view->set_atmos (have_atmos);
- _time_axis_view->set_y (tracks() * track_height() + 64);
+ _time_axis_view->set_y (tracks());
_reels_view->set_y (8);
}
}
}
}
+
+int
+Timeline::tracks_y_offset () const
+{
+ return _reels_view->bbox().height + 4;
+}
return dcpomatic::Rect<int> (0, _y - 4, _timeline.width(), 24);
}
+/** @param y y position in tracks (not pixels) */
void
TimelineTimeAxisView::set_y (int y)
{
double const mark_interval = calculate_mark_interval (rint (128 / pps));
+ int y = _y * _timeline.track_height() + 32;
+
wxGraphicsPath path = gc->CreatePath ();
- path.MoveToPoint (0, _y);
- path.AddLineToPoint (_timeline.width(), _y);
+ path.MoveToPoint (0, y);
+ path.AddLineToPoint (_timeline.width(), y);
gc->StrokePath (path);
gc->SetFont (gc->CreateFont (*wxNORMAL_FONT));
DCPTime t;
while ((t.seconds() * pps) < _timeline.width()) {
wxGraphicsPath path = gc->CreatePath ();
- path.MoveToPoint (time_x (t), _y - 4);
- path.AddLineToPoint (time_x (t), _y + 4);
+ path.MoveToPoint (time_x (t), y - 4);
+ path.AddLineToPoint (time_x (t), y + 4);
gc->StrokePath (path);
double tc = t.seconds ();
int const tx = t.seconds() * pps;
if ((tx + str_width) < _timeline.width()) {
- gc->DrawText (str, time_x (t), _y + 16);
+ gc->DrawText (str, time_x (t), y + 16);
}
t += DCPTime::from_seconds (mark_interval);