diff options
Diffstat (limited to 'spline-widget/qfunctionconfigurator.h')
-rw-r--r-- | spline-widget/qfunctionconfigurator.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index ce8208a8..ffd1dd78 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015 Stanislaw Halik <sthalik@misaki.pl> +/* Copyright (c) 2012-2016 Stanislaw Halik <sthalik@misaki.pl> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -19,13 +19,12 @@ class SPLINE_WIDGET_EXPORT QFunctionConfigurator : public QWidget { Q_OBJECT Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier) - enum { pointSize = 5 }; public: QFunctionConfigurator(QWidget *parent = 0); - + Map* config(); void setConfig(Map* config, const QString &name); - + QColor colorBezier() const { return spline_color; @@ -57,23 +56,26 @@ protected: void resizeEvent(QResizeEvent *) override; private: void update_range(); - static constexpr int point_closeness_limit = 12; QPointF pixel_coord_to_point (const QPointF& point); - QPointF point_to_pixel (const QPointF& point); + QPointF point_to_pixel(const QPointF& point); Map* _config; - + // bounds of the rectangle user can interact with QRectF pixel_bounds; - + int moving_control_point_idx; QPointF c; QColor spline_color; - + QPixmap _background; QPixmap _function; bool _draw_function; int snap_x, snap_y; + + static constexpr int line_length_pixels = 3; + static constexpr int point_size = 5; + static constexpr int point_closeness_limit = 12; }; |