File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2711,13 +2711,18 @@ void Score::cmdResetBeamMode()
2711
2711
return ;
2712
2712
}
2713
2713
2714
- const staff_idx_t staffStart = selection ().staffStart ();
2715
- const staff_idx_t staffEnd = selection ().staffEnd ();
2714
+ ChordRest* firstCr = selection ().firstChordRest ();
2715
+ if (!firstCr) {
2716
+ LOGD (" no chord/rest in selection" );
2717
+ return ;
2718
+ }
2719
+
2720
+ const track_idx_t trackStart = staff2track (selection ().staffStart ());
2721
+ const track_idx_t trackEnd = staff2track (selection ().staffEnd ());
2716
2722
const Fraction endTick = selection ().tickEnd ();
2717
2723
2718
- for (track_idx_t track = staff2track (staffStart); track < staff2track (staffEnd); ++track) {
2719
- ChordRest* firstCR = selection ().firstChordRest (track);
2720
- for (Segment* seg = firstCR->segment (); seg && seg->tick () < endTick; seg = seg->next1 (SegmentType::ChordRest)) {
2724
+ for (Segment* seg = firstCr->segment (); seg && seg->tick () < endTick; seg = seg->next1 (SegmentType::ChordRest)) {
2725
+ for (track_idx_t track = trackStart; track < trackEnd; ++track) {
2721
2726
ChordRest* cr = toChordRest (seg->element (track));
2722
2727
if (!cr) {
2723
2728
continue ;
You can’t perform that action at this time.
0 commit comments