Skip to content

Commit

Permalink
Fix #305487: Invisible accidentals take space
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmcclinch committed May 20, 2020
1 parent 461f048 commit 116ccc9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libmscore/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1891,7 +1891,7 @@ void Chord::layoutPitched()
lhead = qMax(lhead, -x1);

Accidental* accidental = note->accidental();
if (accidental && !note->fixed()) {
if (accidental && accidental->addToSkyline() && !note->fixed()) {
// convert x position of accidental to segment coordinate system
qreal x = accidental->pos().x() + note->pos().x() + chordX;
// distance from accidental to note already taken into account
Expand Down
2 changes: 1 addition & 1 deletion libmscore/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ void Score::layoutChords3(std::vector<Note*>& notes, const Staff* staff, Segment
for (int i = nNotes-1; i >= 0; --i) {
Note* note = notes[i];
Accidental* ac = note->accidental();
if (ac && !note->fixed()) {
if (ac && ac->addToSkyline() && !note->fixed()) {
ac->layout();
AcEl acel;
acel.note = note;
Expand Down
4 changes: 2 additions & 2 deletions libmscore/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3429,7 +3429,7 @@ Shape Note::shape() const
Shape shape(r, name());
for (NoteDot* dot : _dots)
shape.add(symBbox(SymId::augmentationDot).translated(dot->pos()), dot->name());
if (_accidental)
if (_accidental && _accidental->addToSkyline())
shape.add(_accidental->bbox().translated(_accidental->pos()), _accidental->name());
for (auto e : _el) {
if (e->autoplace() && e->visible()) {
Expand All @@ -3442,7 +3442,7 @@ Shape Note::shape() const
Shape shape(r);
for (NoteDot* dot : _dots)
shape.add(symBbox(SymId::augmentationDot).translated(dot->pos()));
if (_accidental)
if (_accidental && _accidental->addToSkyline())
shape.add(_accidental->bbox().translated(_accidental->pos()));
for (auto e : _el) {
if (e->autoplace() && e->visible()) {
Expand Down

0 comments on commit 116ccc9

Please sign in to comment.