Skip to content

Commit

Permalink
view: fix position sync in 3D datasets
Browse files Browse the repository at this point in the history
now, view will again show the new slice, if we change the slice in a
synced window
  • Loading branch information
hcmh committed Jul 2, 2024
1 parent 2725d7b commit d35cffd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ void view_sync(struct view_s* v)
v2->settings.pos[v->settings.xdim] = v->settings.pos[v->settings.xdim];
v2->settings.pos[v->settings.ydim] = v->settings.pos[v->settings.ydim];

view_window_nosync(v2, v->settings.mode, v->settings.winlow, v->settings.winhigh);
// if we have changed anything outside of the current x/y dims of v2, we need to reinterpolate
// this is common when changing slices in 3D datasets
if ((v2->settings.xdim != v->settings.xdim) || (v2->settings.ydim != v->settings.ydim))
v2->control->invalid = true;

view_window_nosync(v2, v->settings.mode, v->settings.winlow, v->settings.winhigh);
ui_set_params(v2, v2->ui_params, v2->settings);

view_release(v2);
Expand Down

0 comments on commit d35cffd

Please sign in to comment.