return (first_->get_x() + second_->get_x()) / 2.0f;
}
-QPoint CursorPair::point() const
+QPoint CursorPair::point(const QRect &rect) const
{
- return first_->point();
+ return first_->point(rect);
}
pv::widgets::Popup* CursorPair::create_popup(QWidget *parent)
float get_x() const;
- QPoint point() const;
+ QPoint point(const QRect &rect) const;
pv::widgets::Popup* create_popup(QWidget *parent);
return visual_v_offset_ + owner_->owner_visual_v_offset();
}
-QPoint RowItem::point() const
+QPoint RowItem::point(const QRect &rect) const
{
- return QPoint(0, visual_v_offset());
+ return QPoint(rect.right(), visual_v_offset());
}
void RowItem::hover_point_changed()
int get_visual_y() const;
/**
- * Gets the drag point of the row item.
+ * Gets the arrow-tip point of the row item marker.
+ * @param rect the rectangle of the header area.
*/
- QPoint point() const;
+ QPoint point(const QRect &rect) const;
/**
* Computes the vertical extents of the contents of this row item.
return (time_ - view_.offset()) / view_.scale();
}
-QPoint TimeMarker::point() const
+QPoint TimeMarker::point(const QRect &rect) const
{
- return QPoint(get_x(), 0);
+ return QPoint(get_x(), rect.right());
}
QRectF TimeMarker::label_rect(const QRectF &rect) const
float get_x() const;
/**
- * Gets the drag point of the row item.
+ * Gets the arrow-tip point of the time marker.
+ * @param rect the rectangle of the ruler area.
*/
- QPoint point() const;
+ QPoint point(const QRect &rect) const;
/**
* Computes the outline rectangle of a label.
void ViewItem::drag()
{
- drag_point_ = point();
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
/**
* Get the drag point.
+ * @param rect the rectangle of the widget area.
*/
- virtual QPoint point() const = 0;
+ virtual QPoint point(const QRect &rect) const = 0;
/**
* Computes the outline rectangle of a label.