Skip to content

Commit

Permalink
fix #8899 : Delete tremolo notes results in bad rest
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioBL committed Sep 6, 2013
1 parent a8bc292 commit 4e6332b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
// Copyright (C) 2002-2013 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
Expand Down Expand Up @@ -460,6 +460,9 @@ void Chord::remove(Element* e)
int dots = d.dots();
d = d.shift(1);
d.setDots(dots);
Fraction f = duration();
if (f.numerator() > 0)
d = TDuration(f);
if (tremolo->chord1())
tremolo->chord1()->setDurationType(d);
if (tremolo->chord2())
Expand Down
8 changes: 7 additions & 1 deletion libmscore/undo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MuseScore
// Music Composition & Notation
//
// Copyright (C) 2002-2011 Werner Schweer
// Copyright (C) 2002-2013 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
Expand Down Expand Up @@ -1341,6 +1341,12 @@ RemoveElement::RemoveElement(Element* e)
score->undoRemoveElement(cr->tuplet());
if (e->type() == Element::CHORD) {
Chord* chord = static_cast<Chord*>(e);
// remove tremolo between 2 notes
if (chord->tremolo()) {
Tremolo* tremolo = chord->tremolo();
if (tremolo->twoNotes())
score->undoRemoveElement(tremolo);
}
foreach(Note* note, chord->notes()) {
if (note->tieFor() && note->tieFor()->endNote())
score->undoRemoveElement(note->tieFor());
Expand Down

0 comments on commit 4e6332b

Please sign in to comment.