diff --git a/src/scalepicker.h b/src/scalepicker.h --- a/src/scalepicker.h +++ b/src/scalepicker.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -58,17 +59,20 @@ private: double firstPosPx; // pixel coordinates double currentPosPx; // current position in pixel coordinates QList snapPoints; + /// used to restore precision of snappoints that is lost due to rounding + QMap snapPointMap; - double position(double); // returns the axis mouse position relative to plot coordinates + double position(double) const; // returns the axis mouse position relative to plot coordinates int positionPx(QMouseEvent*); // returns the axis mouse position in pixels double posCanvasPx(double pos) const; // returns the given position in canvas coordinates void drawTriangle(QPainter* painter, int position); - -private slots: - /// Returns tracker text position + QwtText trackerText() const; + /// Returns tracker text position QRectF trackerTextRect(QPainter* painter, int posPx, QSizeF textSize) const; /// Returns the text position for tracker text shown during picking QRectF pickTrackerTextRect(QPainter* painter, QRect pickRect, QSizeF textSize) const; + +private slots: void updateSnapPoints(); };