Browse Source

Undo for pedalNotes

master
Nils 6 years ago
parent
commit
40fbf7a19f
  1. 5
      engine/api.py

5
engine/api.py

@ -2235,13 +2235,13 @@ def pedalNotes(pedalDuration):
undoSplit = self.split(newParts) #split uses the temporary note
targetDuration = self.durationGroup.minimumNote.duration.copy()
#Restore the first note to original pitch, but keep the new duration, at least in the mininumNote
self.notelist = originalPitches
self.durationGroup.cacheMinimumNote()
#self.notelist[self.notelist.index(self.durationGroup.minimumNote)] =
self.durationGroup.minimumNote.duration = targetDuration
self.durationGroup.cacheMinimumNote()
return undoSplit
items.Item._replaceWithPedalNotes = replaceWithPedalNotes #this happens each time api.pedalNotes gets called, which is good because the "duration" parameter changes each time.
@ -2249,8 +2249,7 @@ def pedalNotes(pedalDuration):
_applyToSelection("_replaceWithPedalNotes")
else:
_applyToItem("_replaceWithPedalNotes")
session.history.clear()
callbacks._historyChanged()
def mirrorAroundCursor():
if session.data.cursorWhenSelectionStarted:

Loading…
Cancel
Save