Opened 10 years ago

Last modified 8 years ago

#2174 new defect

Tcl NVIZ: load state loads then forgets the "look here" focus position

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: Tcl/Tk NVIZ Version: svn-develbranch6
Keywords: load state, focus Cc:
CPU: x86-64 Platform: Linux

Description

Hi,

In Tcl/Tk NVIZ if you change the map's location on the canvas with the "Look Here" button or change from the puck to the "center" view-adjust method, then 'File -> Save State', the resulting position is successfully saved to the session-state file by Nget_focus(), and is loaded back in ok as part of panel_main.tcl's Nviz_main_load()'s Nset_focus(). But then the focus position gets clobbered (twice) by panel_surf.tcl and panel_vol.c calling "look_center", which resets the view. On a less important note those extra two look_center mean that the screen gets redrawn a couple extra times too; minor performance hit.

Commenting out the two look_center() at the ends of the Nviz_surf_load() and Nviz_vol_load() tcl functions lets it reload the correct original view upon File -> Load State.

I hesitate to commit any change without some sort of check that the focus has already been loaded/set, maybe those two look_center() are there for the first layer to be loaded when starting from a blank canvas? Note that AFAIK the canvas center focus is based on g.region not the bounds of the newly loaded surface/volume, so the view should not have to be recentered because a change of layer.

thanks, Hamish

Change History (1)

comment:1 by neteler, 8 years ago

Milestone: 6.4.46.4.6
Note: See TracTickets for help on using tickets.