Skip to content

Commit

Permalink
Notenames plugins: skip notes that are not selected
Browse files Browse the repository at this point in the history
but in case of a list selection work on all that are (except invisble ones), not just the first

Backport of musescore#8142, part 2
  • Loading branch information
Jojo-Schmitz committed Jul 28, 2021
1 parent f32283a commit c62412e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions share/plugins/notenames-interactive.qml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ MuseScore {
var notes = chord.notes;
var sep = "\n"; // change to "," if you want them horizontally (anybody?)
for (var i = 0; i < notes.length; i++) {
if (!notes[i].visible)
continue // skip invisible notes
if ((curScore.selection.elements.length && !notes[i].selected) || !notes[i].visible)
continue // skip notes a that are not selected or invisible
if (text) // only if text isn't empty
text = sep + text;
if (typeof notes[i].tpc === "undefined") // like for grace notes ?!?
Expand Down
4 changes: 2 additions & 2 deletions share/plugins/notenames.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ MuseScore {
function nameChord (notes, text, small) {
var sep = "\n"; // change to "," if you want them horizontally (anybody?)
for (var i = 0; i < notes.length; i++) {
if (!notes[i].visible)
continue // skip invisible notes
if ((curScore.selection.elements.length && !notes[i].selected) || !notes[i].visible)
continue // skip notes that are not selected or invisible
if (text.text) // only if text isn't empty
text.text = sep + text.text;
if (small)
Expand Down

0 comments on commit c62412e

Please sign in to comment.