From fbd247a5c5f098688e98e77af95505422db62ef1 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 28 Feb 2011 17:34:33 +0100 Subject: hdfsee: Mark features according to geometry --- src/displaywindow.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/displaywindow.c b/src/displaywindow.c index b542f269..3329649e 100644 --- a/src/displaywindow.c +++ b/src/displaywindow.c @@ -249,20 +249,35 @@ static gboolean displaywindow_expose(GtkWidget *da, GdkEventExpose *event, return FALSE; } - cairo_identity_matrix(cr); + /* Ensure a clean Cairo context, since the rings often cause + * matrix trouble */ + cairo_destroy(cr); + cr = gdk_cairo_create(da->window); + + cairo_set_matrix(cr, &basic_m); for ( i=0; iimage->features); i++ ) { - double x, y; + double fs, ss; + double x, y, xs, ys; struct imagefeature *f; + struct panel *p; f = image_get_feature(dw->image->features, i); if ( f == NULL ) continue; - x = f->x / (double)dw->binning; - y = dw->height - f->y / (double)dw->binning; + fs = f->x; + ss = f->y; + + p = find_panel(dw->image->det, fs, ss); + if ( p == NULL ) continue; + + xs = (fs-p->min_fs)*p->fsx + (ss-p->min_ss)*p->ssx; + ys = (fs-p->min_fs)*p->fsy + (ss-p->min_ss)*p->ssy; + x = xs + p->cnx; + y = ys + p->cny; - cairo_new_path(cr); - cairo_arc(cr, x, y, 7.0/dw->binning, 0.0, 2.0*M_PI); + cairo_arc(cr, x/dw->binning, y/dw->binning, + 7.0/dw->binning, 0.0, 2.0*M_PI); switch ( dw->scale ) { case SCALE_COLOUR : -- cgit v1.2.3