diff options
-rw-r--r-- | src/crystfelimageview.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c index d6e898b6..35636a73 100644 --- a/src/crystfelimageview.c +++ b/src/crystfelimageview.c @@ -45,6 +45,9 @@ #include "crystfelimageview.h" +static int rerender_image(CrystFELImageView *iv); + + static void scroll_interface_init(GtkScrollable *iface) { } @@ -675,10 +678,6 @@ static void detgeom_pixel_extents(struct detgeom *det, static int reload_image(CrystFELImageView *iv) { - int n_pb; - double min_x, min_y, max_x, max_y; - double border; - if ( iv->dtempl == NULL ) return 0; if ( iv->filename == NULL ) return 0; @@ -690,6 +689,16 @@ static int reload_image(CrystFELImageView *iv) return 1; } + return rerender_image(iv); +} + + +static int rerender_image(CrystFELImageView *iv) +{ + int n_pb; + double min_x, min_y, max_x, max_y; + double border; + iv->pixbufs = render_panels(iv->image, 1, SCALE_COLOUR, iv->brightness, &n_pb); if ( n_pb != iv->image->detgeom->n_panels ) { @@ -778,5 +787,5 @@ void crystfel_image_view_set_brightness(CrystFELImageView *iv, double brightness) { iv->brightness = brightness; - reload_image(iv); + rerender_image(iv); } |