diff --git a/src/gui/widgets/timeline/timeline-layout-helper.cpp b/src/gui/widgets/timeline/timeline-layout-helper.cpp index 85864b4ea..2116641fc 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.cpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.cpp @@ -88,8 +88,12 @@ TimelineLayoutHelper::get_track_header_rect( } shared_ptr -TimelineLayoutHelper::header_from_point(const Gdk::Point &point) +TimelineLayoutHelper::header_from_point(Gdk::Point point) { + // Apply the scroll offset + point.set_y(point.get_y() + timelineWidget.get_y_scroll_offset()); + + // Search the headers std::pair, Gdk::Rectangle> pair; BOOST_FOREACH( pair, headerBoxes ) { @@ -108,8 +112,12 @@ TimelineLayoutHelper::header_from_point(const Gdk::Point &point) } boost::shared_ptr -TimelineLayoutHelper::track_from_y(const int y) +TimelineLayoutHelper::track_from_y(int y) { + // Apply the scroll offset + y += timelineWidget.get_y_scroll_offset(); + + // Search the tracks std::pair, Gdk::Rectangle> pair; BOOST_FOREACH( pair, headerBoxes ) { diff --git a/src/gui/widgets/timeline/timeline-layout-helper.hpp b/src/gui/widgets/timeline/timeline-layout-helper.hpp index 39c01ea4b..0960afd10 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.hpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.hpp @@ -70,9 +70,9 @@ public: boost::weak_ptr track); boost::shared_ptr header_from_point( - const Gdk::Point &point); + Gdk::Point point); - boost::shared_ptr track_from_y(const int y); + boost::shared_ptr track_from_y(int y); int get_total_height() const;