diff options
author | Thomas White <taw@physics.org> | 2020-02-28 23:40:49 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:42:24 +0200 |
commit | 00fef1ce0333b4a0a425ea1cbd5855caa16b4041 (patch) | |
tree | d4bf4f8fd57b97568782801b45d858c6ebb6771c | |
parent | 9efa86e0fbc8e566b0c5a136d805a9e3e2065cbb (diff) |
Render panels correctly
-rw-r--r-- | src/crystfelimageview.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c index 2a4b9212..001a7ca7 100644 --- a/src/crystfelimageview.c +++ b/src/crystfelimageview.c @@ -179,10 +179,15 @@ static void draw_panel_rectangle(cairo_t *cr, CrystFELImageView *iv, int i) gdk_cairo_set_source_pixbuf(cr, iv->pixbufs[i], 0.0, 0.0); patt = cairo_get_source(cr); - cairo_pattern_set_filter(patt, CAIRO_FILTER_NEAREST); - cairo_matrix_init_identity(&m); + + cairo_pattern_get_matrix(patt, &m); + cairo_matrix_scale(&m, 1.0/p.pixel_pitch, 1.0/p.pixel_pitch); cairo_pattern_set_matrix(patt, &m); + + cairo_pattern_set_filter(patt, CAIRO_FILTER_NEAREST); + cairo_rectangle(cr, 0.0, 0.0, p.w*p.pixel_pitch, p.h*p.pixel_pitch); + cairo_fill(cr); } @@ -204,10 +209,6 @@ static gint draw_sig(GtkWidget *window, cairo_t *cr, CrystFELImageView *iv) for ( i=0; i<iv->image->detgeom->n_panels; i++ ) { cairo_save(cr); draw_panel_rectangle(cr, iv, i); - cairo_fill_preserve(cr); - cairo_set_source_rgb(cr, 0.0, 0.0, 0.0); - cairo_set_line_width(cr, 0.0002); - cairo_stroke(cr); cairo_restore(cr); } } |