aboutsummaryrefslogtreecommitdiff
path: root/src/displaywindow.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-02-27 23:02:33 +0100
committerThomas White <taw@physics.org>2012-02-22 15:27:16 +0100
commit4e31162cb8f3025f56f824cee4be5a3cbf05692c (patch)
tree4a78a6834d32281a975115009a58661eebca2c38 /src/displaywindow.c
parent0fec1e14ddf2af984a8b75b3caccb73e125127f9 (diff)
hdfsee: Fix HDF5 element switching
Diffstat (limited to 'src/displaywindow.c')
-rw-r--r--src/displaywindow.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/displaywindow.c b/src/displaywindow.c
index e19b1995..1abcec41 100644
--- a/src/displaywindow.c
+++ b/src/displaywindow.c
@@ -1163,8 +1163,15 @@ static gint displaywindow_newhdf(GtkMenuItem *item, struct newhdf *nh)
/* Check that the geometry still fits */
if ( !geometry_fits(nh->dw->image, nh->dw->simple_geom) ) {
+ int using = 0;
+ if ( nh->dw->simple_geom == nh->dw->image->det ) {
+ using = 1;
+ }
free_detector_geometry(nh->dw->simple_geom);
nh->dw->simple_geom = simple_geometry(nh->dw->image);
+ if ( using ) {
+ nh->dw->image->det = nh->dw->simple_geom;
+ }
}
if ( (nh->dw->loaded_geom != NULL )
@@ -1173,12 +1180,15 @@ static gint displaywindow_newhdf(GtkMenuItem *item, struct newhdf *nh)
GtkWidget *w;
free_detector_geometry(nh->dw->loaded_geom);
+ nh->dw->loaded_geom = NULL;
+ /* Force out of "use geometry" mode */
w = gtk_ui_manager_get_widget(nh->dw->ui,
"/ui/displaywindow/view/usegeom");
gtk_widget_set_sensitive(GTK_WIDGET(w), FALSE);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(w), FALSE);
nh->dw->use_geom = 0;
+ nh->dw->image->det = nh->dw->simple_geom;
}