From 2521a7918783758928a58f6032ca6fad53a89c01 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 6 Nov 2015 21:18:13 +0100 Subject: spline: snap x, y coordinates to grid --- spline-widget/qfunctionconfigurator.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'spline-widget/qfunctionconfigurator.h') diff --git a/spline-widget/qfunctionconfigurator.h b/spline-widget/qfunctionconfigurator.h index 4a9cb5f1..d4ba904a 100644 --- a/spline-widget/qfunctionconfigurator.h +++ b/spline-widget/qfunctionconfigurator.h @@ -39,6 +39,8 @@ public: _background = QPixmap(); update(); } + void set_snap(int x, int y) { snap_x = x; snap_y = y; } + void get_snap(int& x, int& y) const { x = snap_x; y = snap_y; } protected slots: void paintEvent(QPaintEvent *e) override; void mousePressEvent(QMouseEvent *e) override; @@ -72,4 +74,5 @@ private: QPixmap _background; QPixmap _function; bool _draw_function; + int snap_x, snap_y; }; -- cgit v1.2.3