From f474c3c923fe5bb27c1ee11e2c6dd57e41889f27 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 2 Oct 2011 09:58:10 +0200 Subject: Made conenctions for CanvasTool work (again...). --- dgedit/canvastoolselections.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'dgedit/canvastoolselections.cc') 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 +#include #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() -- cgit v1.2.3