summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/spline-widget.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'spline-widget/spline-widget.hpp')
-rw-r--r--spline-widget/spline-widget.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/spline-widget/spline-widget.hpp b/spline-widget/spline-widget.hpp
index d52e249c..921f44a2 100644
--- a/spline-widget/spline-widget.hpp
+++ b/spline-widget/spline-widget.hpp
@@ -32,6 +32,8 @@ class OPENTRACK_SPLINE_EXPORT spline_widget final : public QWidget
Q_OBJECT
Q_PROPERTY(QColor colorBezier READ colorBezier WRITE setColorBezier)
Q_PROPERTY(bool is_preview_only READ is_preview_only WRITE set_preview_only)
+ Q_PROPERTY(int x_step READ x_step WRITE set_x_step)
+ Q_PROPERTY(int y_step READ y_step WRITE set_y_step)
using points_t = spline::points_t;
public:
@@ -47,6 +49,12 @@ public:
void force_redraw();
void set_preview_only(bool val);
bool is_preview_only() const;
+
+ double x_step() { return _x_step; }
+ double y_step() { return _y_step; }
+ void set_x_step(double val) { _x_step = val; }
+ void set_y_step(double val) { _y_step = val; }
+
void set_snap(double x, double y) { snap_x = x; snap_y = y; }
void get_snap(double& x, double& y) const { x = snap_x; y = snap_y; }
protected slots:
@@ -57,7 +65,7 @@ protected slots:
void reload_spline();
private:
int get_closeness_limit();
- void show_tooltip(const QPoint& pos, const QPointF& value = QPointF(0, 0), const QString& prefix = QStringLiteral(""));
+ void show_tooltip(const QPoint& pos, const QPointF& value = QPointF(0, 0));
bool is_in_bounds(const QPoint& pos) const;
void drawBackground();
@@ -89,6 +97,7 @@ private:
QMetaObject::Connection connection;
double snap_x, snap_y;
+ double _x_step, _y_step;
int moving_control_point_idx;
bool _draw_function, _preview_only;