aboutsummaryrefslogtreecommitdiff
path: root/src/displaywindow.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-02-28 17:34:33 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:16 +0100
commitfbd247a5c5f098688e98e77af95505422db62ef1 (patch)
treeff612308a04225004842fec95eb0347092655679 /src/displaywindow.c
parentc080e2c362628da1a68ad17c117f303945724006 (diff)
hdfsee: Mark features according to geometry
Diffstat (limited to 'src/displaywindow.c')
-rw-r--r--src/displaywindow.c27
1 files changed, 21 insertions, 6 deletions
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; i<image_feature_count(dw->image->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 :