Browse Source

repair block data change undo

master
Nils 4 years ago
parent
commit
72f62e0454
  1. 3
      engine/api.py

3
engine/api.py

@ -896,9 +896,10 @@ def changeBlock(blockId, newParametersDict):
"""for example "name" or "minimumInTicks" """
track, block = session.data.blockById(blockId)
moveFunction = _createLambdaMoveToForCurrentPosition()
oldData = block.getDataAsDict()
def registeredUndoFunction():
moveFunction()
changeBlock(blockId, block.getDataAsDict())
changeBlock(blockId, oldData)
session.history.register(registeredUndoFunction, descriptionString = "change block")
block.putDataFromDict(newParametersDict)
callbacks._updateTrack(id(track))

Loading…
Cancel
Save