const pv::util::Timestamp CursorPair::time() const
{
- return (first_->time() + second_->time()) / 2.0f;
+ return 0;
}
float CursorPair::get_x() const
shared_ptr<TimeItem> Ruler::get_reference_item() const
{
+ // Note: time() returns 0 if item returns no valid time
+
if (mouse_modifiers_ & Qt::ShiftModifier)
return nullptr;
- if (hover_item_)
+ if (hover_item_ && (hover_item_->time() != 0))
return hover_item_;
shared_ptr<TimeItem> ref_item;
}
}
+ if (ref_item && (ref_item->time() == 0))
+ ref_item.reset();
+
return ref_item;
}
*/
virtual void set_time(const pv::util::Timestamp& time) = 0;
+ /**
+ * Returns the time this time item is set to.
+ * @return 0 in case there is no valid time (e.g. for a cursor pair)
+ */
virtual const pv::util::Timestamp time() const = 0;
virtual float get_x() const = 0;