Skip to content
Snippets Groups Projects
Commit 1c636225 authored by Paul McCarthy's avatar Paul McCarthy
Browse files

Image data changes were not being recorded properly by the editor, so

couldn't be undone/redone. Fill+clear selection is now grouped into a
single change.
parent 0a31ff50
No related branches found
No related tags found
No related merge requests found
......@@ -147,6 +147,8 @@ class Editor(props.HasProperties):
selectBlock = selectBlock == 0
newVals[selectBlock] = oldVals[selectBlock]
oldVals = np.array(oldVals)
change = ValueChange(overlay, opts.volume, offset, oldVals, newVals)
self._applyChange(change)
......@@ -266,6 +268,9 @@ class Editor(props.HasProperties):
else: volume = None
if isinstance(change, ValueChange):
log.debug('Reverting image data change - offset '
'{}, volume {}, size {}'.format(
change.offset, change.volume, change.oldVals.shape))
change.overlay.applyChange(change.offset, change.oldVals, volume)
elif isinstance(change, SelectionChange):
......
......@@ -42,8 +42,10 @@ class OrthoEditProfile(orthoviewprofile.OrthoViewProfile):
def fillSelection(self, *a):
self._editor.startChangeGroup()
self._editor.fillSelection(self.fillValue)
self._editor.getSelection().clearSelection()
self._editor.endChangeGroup()
def undo(self, *a):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment