From a1bb441471131ed15e9820576b82b9e3172ab1c0 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 27 May 2013 14:45:43 +0200 Subject: hdfsee: Fix display of feature names (indices) when using geometry --- src/dw-hdfsee.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c index a4101eb0..92276ada 100644 --- a/src/dw-hdfsee.c +++ b/src/dw-hdfsee.c @@ -1341,6 +1341,9 @@ static void numbers_update(DisplayWindow *dw) int imin; double dmin; struct imagefeature *f; + int ffs = 0; + int fss = 0; + int found = 0; for ( px=0; px<17; px++ ) { for ( py=0; py<17; py++ ) { @@ -1381,6 +1384,12 @@ static void numbers_update(DisplayWindow *dw) } } + if ( (px==8) && (py==8) ) { + ffs = fs; + fss = ss; + found = 1; + } + } else { strcpy(s, "-"); } @@ -1392,17 +1401,21 @@ static void numbers_update(DisplayWindow *dw) if ( dw->image->features == NULL ) return; - f = image_feature_closest(dw->image->features, - dw->binning * dw->numbers_window->cx, - dw->binning * dw->numbers_window->cy, - &dmin, &imin); - if ( dmin < dw->ring_radius*dw->binning ) { - gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), - f->name); - } else { - gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), - "-"); - } + if ( found ) { + + f = image_feature_closest(dw->image->features, ffs, fss, + &dmin, &imin); + if ( dmin < dw->ring_radius*dw->binning ) { + gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), + f->name); + } else { + gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), + ""); + } + + } else { + gtk_label_set_text(GTK_LABEL(dw->numbers_window->feat), ""); + } } -- cgit v1.2.3