namespace view {
ViewItemPaintParams::ViewItemPaintParams(
- int left, int right, double scale, double offset) :
- left_(left),
- right_(right),
+ const QRect &rect, double scale, double offset) :
+ rect_(rect),
scale_(scale),
offset_(offset) {
- assert(left <= right);
assert(scale > 0.0);
}
class ViewItemPaintParams
{
public:
- ViewItemPaintParams(int left, int right, double scale, double offset);
+ ViewItemPaintParams(const QRect &rect, double scale, double offset);
- int left() const {
- return left_;
- }
-
- int right() const {
- return right_;
+ QRect rect() const {
+ return rect_;
}
double scale() const {
return offset_;
}
+ int left() const {
+ return rect_.left();
+ }
+
+ int right() const {
+ return rect_.right();
+ }
+
+ int top() const {
+ return rect_.top();
+ }
+
+ int bottom() const {
+ return rect_.bottom();
+ }
+
int width() const {
- return right_ - left_;
+ return rect_.width();
+ }
+
+ int height() const {
+ return rect_.width();
}
double pixels_offset() const {
static int text_height();
private:
- int left_;
- int right_;
+ QRect rect_;
double scale_;
double offset_;
};
if (view_.cursors_shown())
view_.cursors()->draw_viewport_background(p, rect());
- const ViewItemPaintParams pp(0, width(), view_.scale(), view_.offset());
+ const ViewItemPaintParams pp(rect(), view_.scale(), view_.offset());
// Plot the signal
for (const shared_ptr<RowItem> r : row_items)