Skip to content

Commit

Permalink
Toggle linked chord's children's visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Aug 8, 2024
1 parent 13af815 commit e15e52a
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/engraving/dom/edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5684,28 +5684,28 @@ static void undoChangeNoteVisibility(Note* note, bool visible)
ElementType::LEDGER_LINE, // temporary objects, impossible to change visibility
};

for (Chord* chord : chords) {
if (chord != noteChord) {
chordHasVisibleNote_ = chordHasVisibleNote(chord);
}

for (EngravingObject* child : chord->scanChildren()) {
ElementType type = child->type();

if (muse::contains(IGNORED_TYPES, type)) {
continue;
}

if (beam) {
if (type == ElementType::STEM || type == ElementType::BEAM) {
child->undoChangeProperty(Pid::VISIBLE, beamHasVisibleNote_);
for (const Chord* chord : chords) {
for (const EngravingObject* obj : chord->linkList()) {
const Chord* linkedChord = toChord(obj);
chordHasVisibleNote_ = chordHasVisibleNote(linkedChord);
for (EngravingObject* child : linkedChord->scanChildren()) {
const ElementType type = child->type();

if (muse::contains(IGNORED_TYPES, type)) {
continue;
}
}
if (child->isOrnament()) {
undoChangeOrnamentVisibility(toOrnament(child), visible);
} else {
child->undoChangeProperty(Pid::VISIBLE, chordHasVisibleNote_);

if (beam) {
if (type == ElementType::STEM || type == ElementType::BEAM) {
child->undoChangeProperty(Pid::VISIBLE, beamHasVisibleNote_);
continue;
}
}
if (child->isOrnament()) {
undoChangeOrnamentVisibility(toOrnament(child), visible);
} else {
child->undoChangeProperty(Pid::VISIBLE, chordHasVisibleNote_);
}
}
}
}
Expand Down

0 comments on commit e15e52a

Please sign in to comment.