X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitempaintparams.hpp;h=73551e6d7f67b7f85cc4c893bb2f8923d8ce6fa1;hp=3128ef4802c3ce902f9791ccec2e607f803e1744;hb=0f95449910ba4022c2f14196163e77cff9620987;hpb=5b5fa4da3b7112414b9f51e6626ae7f4bf606f02 diff --git a/pv/view/viewitempaintparams.hpp b/pv/view/viewitempaintparams.hpp index 3128ef48..73551e6d 100644 --- a/pv/view/viewitempaintparams.hpp +++ b/pv/view/viewitempaintparams.hpp @@ -29,14 +29,10 @@ namespace view { 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 { @@ -47,8 +43,28 @@ public: 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_.height(); } double pixels_offset() const { @@ -61,8 +77,7 @@ public: static int text_height(); private: - int left_; - int right_; + QRect rect_; double scale_; double offset_; };