saalfeldlab / paintera

GNU General Public License v2.0
95 stars 17 forks source link

fix: stop translation from occurring during erase #447

Closed cmhulbert closed 2 years ago

cmhulbert commented 2 years ago

A bug was discovered where right-click and drag to erase would also cause the orthoslice to translate in the xy plane, as if you where not in Paint Mode. This was caused when the Viewer lost focus (from clicking off Paintera, or minimizing) during Shape Interpolation Mode. When this occurred, the active viewer was null and so the navigation actions would not be removed from the previous viewer, and would persist when the window was maximized again.

The solution changes the LazyForeignValue which only contains a single item, to a LazyForeignMap which retains the ActionSets from the previous Viewer, even when it is no longer active. This means when we do finally remove the ActionSets, they are the same instances we installed initially, not a new copy.