summaryrefslogtreecommitdiffhomepage
path: root/spline-widget/qfunctionconfigurator.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-06 21:18:13 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-06 21:18:13 +0100
commit2521a7918783758928a58f6032ca6fad53a89c01 (patch)
treea34eda1e01b44133b7a1d6035f101662e7c292d2 /spline-widget/qfunctionconfigurator.h
parent0fb267c19925a949a8b1f8c62d9fbe52ba821d3d (diff)
spline: snap x, y coordinates to grid
Diffstat (limited to 'spline-widget/qfunctionconfigurator.h')
-rw-r--r--spline-widget/qfunctionconfigurator.h3
1 files changed, 3 insertions, 0 deletions
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;
};