X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Fviewitempaintparams.hpp;h=460bd6c94db8d33a263d433498158310ab273419;hp=73551e6d7f67b7f85cc4c893bb2f8923d8ce6fa1;hb=60d9b99a32e551cffd2b537d3e157d578a761c9b;hpb=0f95449910ba4022c2f14196163e77cff9620987 diff --git a/pv/view/viewitempaintparams.hpp b/pv/view/viewitempaintparams.hpp index 73551e6d..460bd6c9 100644 --- a/pv/view/viewitempaintparams.hpp +++ b/pv/view/viewitempaintparams.hpp @@ -18,8 +18,10 @@ * 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 "pv/util.hpp" #include @@ -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,10 +82,10 @@ public: private: QRect rect_; double scale_; - double offset_; + pv::util::Timestamp offset_; }; } // namespace view } // namespace pv -#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_H +#endif // PULSEVIEW_PV_VIEW_ROWITEMPAINTPARAMS_HPP