projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c915272
)
Fix hidden reels view and time axis not moving under zoom.
author
Carl Hetherington
<cth@carlh.net>
Tue, 3 Jul 2018 22:31:11 +0000
(23:31 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 3 Jul 2018 22:31:11 +0000
(23:31 +0100)
src/wx/timeline.cc
patch
|
blob
|
history
src/wx/timeline.h
patch
|
blob
|
history
src/wx/timeline_content_view.cc
patch
|
blob
|
history
src/wx/timeline_time_axis_view.cc
patch
|
blob
|
history
src/wx/timeline_time_axis_view.h
patch
|
blob
|
history
diff --git
a/src/wx/timeline.cc
b/src/wx/timeline.cc
index 667bf5f873a69081aebab94255093b00fe89077f..480f6d69045b1a9c85db18a206b83ebfd7e18916 100644
(file)
--- a/
src/wx/timeline.cc
+++ b/
src/wx/timeline.cc
@@
-117,7
+117,7
@@
Timeline::paint_labels ()
int vsx, vsy;
_labels_canvas->GetViewStart (&vsx, &vsy);
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->paint (gc, list<dcpomatic::Rect<int> >());
@@
-365,7
+365,7
@@
Timeline::assign_tracks ()
_labels_view->set_subtitle_tracks (subtitle_tracks);
_labels_view->set_atmos (have_atmos);
_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);
}
_reels_view->set_y (8);
}
@@
-745,3
+745,9
@@
Timeline::set_selection (ContentList selection)
}
}
}
}
}
}
+
+int
+Timeline::tracks_y_offset () const
+{
+ return _reels_view->bbox().height + 4;
+}
diff --git
a/src/wx/timeline.h
b/src/wx/timeline.h
index 1b75f7ab2f6c62aeb8dab320abb8b6c396dfb204..503025f3ce3e6f0006a237505db422ae9d386a33 100644
(file)
--- a/
src/wx/timeline.h
+++ b/
src/wx/timeline.h
@@
-77,6
+77,8
@@
public:
_tool = t;
}
_tool = t;
}
+ int tracks_y_offset () const;
+
private:
void paint_labels ();
void paint_main ();
private:
void paint_labels ();
void paint_main ();
diff --git
a/src/wx/timeline_content_view.cc
b/src/wx/timeline_content_view.cc
index abb671b770695e217a1c234423317c8730173553..1d0c1668f0a2840f490097d90165f1ee8ffce44d 100644
(file)
--- a/
src/wx/timeline_content_view.cc
+++ b/
src/wx/timeline_content_view.cc
@@
-156,7
+156,7
@@
TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
int
TimelineContentView::y_pos (int t) const
{
int
TimelineContentView::y_pos (int t) const
{
- return t * _timeline.track_height();
+ return t * _timeline.track_height()
+ _timeline.tracks_y_offset()
;
}
void
}
void
diff --git
a/src/wx/timeline_time_axis_view.cc
b/src/wx/timeline_time_axis_view.cc
index c8808a62f5c6b35a0553f825918410171231988f..1d7aefb738d4df0bcdf758bdfec9a2fa5343749a 100644
(file)
--- 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);
}
return dcpomatic::Rect<int> (0, _y - 4, _timeline.width(), 24);
}
+/** @param y y position in tracks (not pixels) */
void
TimelineTimeAxisView::set_y (int y)
{
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));
double const mark_interval = calculate_mark_interval (rint (128 / pps));
+ int y = _y * _timeline.track_height() + 32;
+
wxGraphicsPath path = gc->CreatePath ();
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));
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 ();
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 ();
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()) {
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);
}
t += DCPTime::from_seconds (mark_interval);
diff --git
a/src/wx/timeline_time_axis_view.h
b/src/wx/timeline_time_axis_view.h
index 5eecb8232a5e0eadd512a311abe568fb8f13b843..5477e61f13cfaf660f5c95af1ab480e0383a0d32 100644
(file)
--- a/
src/wx/timeline_time_axis_view.h
+++ b/
src/wx/timeline_time_axis_view.h
@@
-31,6
+31,5
@@
public:
private:
void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps);
private:
void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps);
- int _y;
+ int _y;
///< y position in tracks (not pixels)
};
};
-