]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/cursorpair.cpp
Fix compiler warnings
[pulseview.git] / pv / views / trace / cursorpair.cpp
index b940090ac8b68861d95ab5e16dec80f630b8cebc..ba65e6c19a21c8e416582799057dea2666c0cfd9 100644 (file)
@@ -84,11 +84,24 @@ void CursorPair::set_time(const pv::util::Timestamp& time)
        second_->set_time(time + delta);
 }
 
+const pv::util::Timestamp CursorPair::time() const
+{
+       return 0;
+}
+
 float CursorPair::get_x() const
 {
        return (first_->get_x() + second_->get_x()) / 2.0f;
 }
 
+const pv::util::Timestamp CursorPair::delta(const pv::util::Timestamp& other) const
+{
+       if (other < second_->time())
+               return other - first_->time();
+       else
+               return other - second_->time();
+}
+
 QPoint CursorPair::drag_point(const QRect &rect) const
 {
        return first_->drag_point(rect);