X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitempaintparams.hpp;h=86742ba7ceb811ec1e3642f7ee15e1776ac1e36e;hp=3128ef4802c3ce902f9791ccec2e607f803e1744;hb=7a01bd3654ed046216308fa64edfd79be7cd525f;hpb=5b5fa4da3b7112414b9f51e6626ae7f4bf606f02 diff --git a/pv/view/viewitempaintparams.hpp b/pv/view/viewitempaintparams.hpp index 3128ef4..86742ba 100644 --- a/pv/view/viewitempaintparams.hpp +++ b/pv/view/viewitempaintparams.hpp @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H -#define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H +#ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP +#define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP #include @@ -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_; }; @@ -70,4 +85,4 @@ private: } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H +#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP