projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull methods out of CinemaKDMs.
[dcpomatic.git]
/
src
/
wx
/
timeline_time_axis_view.cc
diff --git
a/src/wx/timeline_time_axis_view.cc
b/src/wx/timeline_time_axis_view.cc
index c8808a62f5c6b35a0553f825918410171231988f..e9de1b542fab6b1777993b09a920009d420903bc 100644
(file)
--- a/
src/wx/timeline_time_axis_view.cc
+++ b/
src/wx/timeline_time_axis_view.cc
@@
-25,6
+25,8
@@
#include <wx/graphics.h>
using std::list;
#include <wx/graphics.h>
using std::list;
+using std::cout;
+using namespace dcpomatic;
TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y)
: TimelineView (tl)
TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y)
: TimelineView (tl)
@@
-39,6
+41,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
+62,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.pixels_per_track() + 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
+75,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
+95,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);