X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fview%2Fviewitempaintparams.hpp;h=354d8c5cfe3edc976df6e83645712453f4e8a683;hb=cbf7b5db5c3c04b95daf77bc0e6dc112c15e0195;hp=a8b519067250976ff0990a510d93a5f2bca6df72;hpb=36e7001de1e6620deeb93fa77c2ec6c4ebc4b3ea;p=pulseview.git diff --git a/pv/view/viewitempaintparams.hpp b/pv/view/viewitempaintparams.hpp index a8b51906..354d8c5c 100644 --- a/pv/view/viewitempaintparams.hpp +++ b/pv/view/viewitempaintparams.hpp @@ -18,18 +18,23 @@ * 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_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP +#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP + +#include "pv/util.hpp" #include +#include namespace pv { -namespace view { +namespace views { +namespace TraceView { class ViewItemPaintParams { public: - ViewItemPaintParams(const QRect &rect, double scale, double offset); + ViewItemPaintParams( + const QRect &rect, double scale, const pv::util::Timestamp& offset); QRect rect() const { return rect_; @@ -39,7 +44,7 @@ public: return scale_; } - double offset() const { + const pv::util::Timestamp& offset() const { return offset_; } @@ -64,11 +69,11 @@ public: } int height() const { - return rect_.width(); + return rect_.height(); } double pixels_offset() const { - return offset_ / scale_; + return (offset_ / scale_).convert_to(); } public: @@ -79,10 +84,11 @@ public: private: QRect rect_; double scale_; - double offset_; + pv::util::Timestamp offset_; }; -} // namespace view +} // namespace TraceView +} // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H +#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP