Adding a LayoutBreak to the selection returns a "Cannot select LayoutBreak"
I've got a piece of code that isolate different elements from the cursor in order to reselect them individually.
The "re-selection" code is the following:
curScore.selection.clear(); for (var i = 0; i < harmonies.length; i++) { curScore.selection.select(harmonies[i], true); } for (var i = 0; i < infos.length; i++) { console.log("selecting "+infos[i].userName()); curScore.selection.select(infos[i], true); }
where harmonies
are elements of type Element.HARMONY
and infos
are elements of type Element.LAYOUT_BREAK
.
Adding the Element.LAYOUT_BREAK
elements throws the following warning:
Warning: Cannot select element of type LayoutBreak
Any idea why ?
Comments
https://github.com/musescore/MuseScore/blob/3.x/mscore/plugin/api/selec…
In reply to https://github.com/musescore… by jeetee
Thanks for pointing this to me. Strange decision as one can add manually LAYOUT_BREAKs to the current selection. Won't discuss it. I took another approach.