X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitempaintparams.hpp;h=460bd6c94db8d33a263d433498158310ab273419;hp=86742ba7ceb811ec1e3642f7ee15e1776ac1e36e;hb=60d9b99a32e551cffd2b537d3e157d578a761c9b;hpb=dae21ebcf60d6a5d7c194736b1dc792a5cbf06a5 diff --git a/pv/view/viewitempaintparams.hpp b/pv/view/viewitempaintparams.hpp index 86742ba7..460bd6c9 100644 --- a/pv/view/viewitempaintparams.hpp +++ b/pv/view/viewitempaintparams.hpp @@ -21,6 +21,8 @@ #ifndef PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP #define PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP +#include "pv/util.hpp" + #include namespace pv { @@ -29,7 +31,8 @@ namespace view { 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 +42,7 @@ public: return scale_; } - double offset() const { + const pv::util::Timestamp& offset() const { return offset_; } @@ -68,7 +71,7 @@ public: } double pixels_offset() const { - return offset_ / scale_; + return (offset_ / scale_).convert_to(); } public: @@ -79,7 +82,7 @@ public: private: QRect rect_; double scale_; - double offset_; + pv::util::Timestamp offset_; }; } // namespace view