summaryrefslogtreecommitdiff
path: root/src/canvastoolthreshold.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/canvastoolthreshold.cc')
-rw-r--r--src/canvastoolthreshold.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/canvastoolthreshold.cc b/src/canvastoolthreshold.cc
index bafee70..a905766 100644
--- a/src/canvastoolthreshold.cc
+++ b/src/canvastoolthreshold.cc
@@ -28,15 +28,19 @@
#include <math.h>
+#include "project.h"
+
#define mapX(x) canvas->mapX(x)
#define mapY(x) canvas->mapY(x)
#define unmapX(x) canvas->unmapX(x)
#define unmapY(x) canvas->unmapY(x)
-CanvasToolThreshold::CanvasToolThreshold(Canvas* c)
+CanvasToolThreshold::CanvasToolThreshold(Canvas* c, Instrument& instrument)
+ : instrument(instrument)
{
canvas = c;
- threshold = 0.5;
+ threshold = instrument.getThreshold();
+
threshold_is_moving = false;
colThreshold = QColor(255, 127, 127);
@@ -72,7 +76,7 @@ bool CanvasToolThreshold::mouseMoveEvent(QMouseEvent* event)
canvas->update();
emit thresholdChanging(threshold);
-
+ instrument.setThreshold(threshold);
return true;
}
@@ -117,7 +121,7 @@ bool CanvasToolThreshold::mouseReleaseEvent(QMouseEvent* event)
canvas->update();
emit thresholdChanged(threshold);
-
+ instrument.setThreshold(threshold);
return true;
}
}