diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-22 12:19:13 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 22:59:58 +0200 |
commit | 87d70f561c07f2d12757589039b0969ead222068 (patch) | |
tree | bfbd8699128a3340f724f406d09167ba82dc088c /spline/spline-widget.hpp | |
parent | cc76bb2e3622f10577de90c3af8653d9c4cbc957 (diff) |
spline: play nice with hidpi, no jaggies allowed
Diffstat (limited to 'spline/spline-widget.hpp')
-rw-r--r-- | spline/spline-widget.hpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spline/spline-widget.hpp b/spline/spline-widget.hpp index 12d21970..ad21eea2 100644 --- a/spline/spline-widget.hpp +++ b/spline/spline-widget.hpp @@ -64,25 +64,24 @@ protected slots: void mouseMoveEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override; private: - int get_closeness_limit(); + double get_closeness_limit(); void show_tooltip(const QPoint& pos, const QPointF& value = QPointF(0, 0)); - bool is_in_bounds(const QPoint& pos) const; + bool is_in_bounds(const QPointF& pos) const; void drawBackground(); void drawFunction(); void drawPoint(QPainter& painter, const QPointF& pt, const QColor& colBG, const QColor& border = QColor(50, 100, 120, 200)); - void drawLine(QPainter& painter, const QPoint& start, const QPoint& end, const QPen& pen); - bool point_within_pixel(const QPointF& pt, const QPoint& pixel); + void drawLine(QPainter& painter, const QPointF& start, const QPointF& end, const QPen& pen); + bool point_within_pixel(const QPointF& pt, const QPointF& pixel); void focusOutEvent(QFocusEvent*e) override; void resizeEvent(QResizeEvent *) override; - bool is_on_pt(const QPoint& pos, int* pt = nullptr); + bool is_on_pt(const QPointF& pos, int* pt = nullptr); void update_range(); - QPointF pixel_coord_to_point(const QPoint& point); - QPointF point_to_pixel_(const QPointF& point); - QPoint point_to_pixel(const QPointF& point); + QPointF pixel_to_point(const QPointF& point); + QPointF point_to_pixel(const QPointF& point); QPointF c; base_spline* _config = nullptr; |