Skip to content

Commit

Permalink
Merge pull request #1153 from oxygen-dioxide/mergenote
Browse files Browse the repository at this point in the history
Ignore slur lyrics when merging notes with Ctrl+U
  • Loading branch information
stakira authored Jun 9, 2024
2 parents 1e617aa + a08e931 commit 93b2919
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OpenUtau/ViewModels/NotesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,13 @@ public void MergeSelectedNotes() {
}
var notes = Selection.ToList();
notes.Sort((a, b) => a.position.CompareTo(b.position));
//Ignore slur lyrics
var mergedLyrics = String.Join("", notes.Select(x => x.lyric).Where(l => !l.StartsWith("+")));
if(mergedLyrics == ""){ //If all notes are slur, the merged note is single slur note
mergedLyrics = notes[0].lyric;
}
DocManager.Inst.StartUndoGroup();
DocManager.Inst.ExecuteCmd(new ChangeNoteLyricCommand(Part, notes[0], String.Join("", notes.Select(x => x.lyric))));
DocManager.Inst.ExecuteCmd(new ChangeNoteLyricCommand(Part, notes[0], mergedLyrics));
DocManager.Inst.ExecuteCmd(new ResizeNoteCommand(Part, notes[0], notes.Last().End - notes[0].End));
notes.RemoveAt(0);
DocManager.Inst.ExecuteCmd(new RemoveNoteCommand(Part, notes));
Expand Down

0 comments on commit 93b2919

Please sign in to comment.