+const int CursorPair::DeltaPadding = 8;
+
+CursorPair::CursorPair(View &view) :
+ first_(new Cursor(view, 0.0)),
+ second_(new Cursor(view, 1.0)),
+ view_(view)
+{
+}
+
+shared_ptr<Cursor> CursorPair::first() const
+{
+ return first_;
+}
+
+shared_ptr<Cursor> CursorPair::second() const
+{
+ return second_;
+}
+
+QRectF CursorPair::get_label_rect(const QRect &rect) const
+{
+ const QSizeF label_size(
+ text_size_.width() + View::LabelPadding.width() * 2,
+ text_size_.height() + View::LabelPadding.height() * 2);
+ const pair<float, float> offsets(get_cursor_offsets());
+ const pair<float, float> normal_offsets(
+ (offsets.first < offsets.second) ? offsets :
+ make_pair(offsets.second, offsets.first));
+
+ const float height = label_size.height();
+ const float left = max(normal_offsets.first + DeltaPadding, -height);
+ const float right = min(normal_offsets.second - DeltaPadding,
+ (float)rect.width() + height);
+
+ return QRectF(left, rect.height() - label_size.height() -
+ Cursor::ArrowSize - Cursor::Offset - 0.5f,
+ right - left, height);
+}
+
+void CursorPair::draw_markers(QPainter &p,
+ const QRect &rect, unsigned int prefix)