diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-07-03 23:31:11 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-07-03 23:31:11 +0100 |
| commit | 5a9373e48aa575c70bd32b4b48eb6b9b8634a4fc (patch) | |
| tree | 9f82092695f26b5d823ff1103e3f62bdc73dea91 /src/wx/timeline_time_axis_view.cc | |
| parent | c9152723208a20542b147e8a879117d6a5a76a45 (diff) | |
Fix hidden reels view and time axis not moving under zoom.
Diffstat (limited to 'src/wx/timeline_time_axis_view.cc')
| -rw-r--r-- | src/wx/timeline_time_axis_view.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc index c8808a62f..1d7aefb73 100644 --- a/src/wx/timeline_time_axis_view.cc +++ b/src/wx/timeline_time_axis_view.cc @@ -39,6 +39,7 @@ TimelineTimeAxisView::bbox () const return dcpomatic::Rect<int> (0, _y - 4, _timeline.width(), 24); } +/** @param y y position in tracks (not pixels) */ void TimelineTimeAxisView::set_y (int y) { @@ -59,9 +60,11 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> 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)); @@ -70,8 +73,8 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> 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 (); @@ -90,7 +93,7 @@ TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> 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); |
