Move y_pos to TimelineView.
authorCarl Hetherington <cth@carlh.net>
Sun, 20 Nov 2022 23:24:31 +0000 (00:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 20 Nov 2022 23:24:31 +0000 (00:24 +0100)
src/wx/timeline_content_view.cc
src/wx/timeline_content_view.h
src/wx/timeline_view.cc
src/wx/timeline_view.h

index 633110c18f9e0d55accdf2fde9770a8ab745e242..5d039d0d3f0a2e82d252da234f63519b8eb4864e 100644 (file)
@@ -171,13 +171,6 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>>
 }
 
 
-int
-TimelineContentView::y_pos (int t) const
-{
-       return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset();
-}
-
-
 void
 TimelineContentView::content_change (ChangeType type, int p)
 {
index 48ca6ed79e49a94731f6887bdb52f9a121511622..aa9832e5db14453accce3c2ae88fa17587d261e8 100644 (file)
@@ -64,7 +64,6 @@ protected:
 private:
 
        void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) override;
-       int y_pos (int t) const;
        void content_change (ChangeType type, int p);
 
        boost::optional<int> _track;
index 10d6dc5beb9d1e4f4d9cf9e1d584ca5c629ce7e5..2897c98e35398a27d83c13c875d6d016b90cc3c3 100644 (file)
@@ -58,3 +58,12 @@ TimelineView::time_x (DCPTime t) const
 {
        return t.seconds() * _timeline.pixels_per_second().get_value_or(0);
 }
+
+
+int
+TimelineView::y_pos(int t) const
+{
+       return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset();
+}
+
+
index f3aa4d5e65ad9983e2490398318eff4762c085d4..166a1121a80df30432a08979dc11c07be043e647 100644 (file)
@@ -52,6 +52,7 @@ protected:
        virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0;
 
        int time_x (dcpomatic::DCPTime t) const;
+       int y_pos(int t) const;
 
        Timeline& _timeline;