summaryrefslogtreecommitdiff
path: root/dgedit/canvastoolselections.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-10-02 09:58:10 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-10-02 09:58:10 +0200
commitf474c3c923fe5bb27c1ee11e2c6dd57e41889f27 (patch)
tree93e2a3e2624bb2e4d238d22124956cd066643b03 /dgedit/canvastoolselections.cc
parent83807cf93ef362098d6fea6030646653cc62e37f (diff)
Made conenctions for CanvasTool work (again...).
Diffstat (limited to 'dgedit/canvastoolselections.cc')
-rw-r--r--dgedit/canvastoolselections.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/dgedit/canvastoolselections.cc b/dgedit/canvastoolselections.cc
index 51cc1ad..ba2d6b0 100644
--- a/dgedit/canvastoolselections.cc
+++ b/dgedit/canvastoolselections.cc
@@ -27,6 +27,7 @@
#include "canvastoolselections.h"
#include <math.h>
+#include <stdio.h>
#define mapX(x) canvas->mapX(x)
#define mapY(x) canvas->mapY(x)
@@ -35,9 +36,11 @@
CanvasToolSelections::CanvasToolSelections(Canvas *c)
{
+ threshold = 0.5; // Default from CanvasToolThreshold
+
canvas = c;
- data = canvas->data;
- size = canvas->size;
+ // data = canvas->data;
+ // size = canvas->size;
selection_is_moving_left = false;
selection_is_moving_right = false;
@@ -185,9 +188,16 @@ void CanvasToolSelections::keyReleaseEvent(QKeyEvent *event)
}
}
+void CanvasToolSelections::thresholdChanged(double t)
+{
+ threshold = t;
+}
+
void CanvasToolSelections::autoCreateSelections()
{
- /*
+ float *data = canvas->data;
+ size_t size = canvas->size;
+
for(size_t i = 0; i < size; i++) {
if(fabs(data[i]) > fabs(threshold)) {
int from = i;
@@ -224,7 +234,6 @@ void CanvasToolSelections::autoCreateSelections()
}
canvas->update();
emit selectionsChanged(_selections);
- */
}
void CanvasToolSelections::clearSelections()