Skip to content

Commit

Permalink
fix #268119 Ottava line lenght wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Sep 26, 2018
1 parent e71d61d commit 92d8c61
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion libmscore/line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,26 @@ QPointF SLine::linePos(Grip grip, System** sys) const
// lay out just past right edge of all notes for this segment on this staff

Segment* s = cr->segment();
qreal width = s->staffShape(staffIdx()).right();

int startTrack = staffIdx() * VOICES;
int endTrack = startTrack + VOICES;
qreal width = 0.0;

// dont consider full measure rests, which are centered
// (TODO: what if there is only a full measure rest?)

for (int track = startTrack; track < endTrack; ++track) {
ChordRest* cr = toChordRest(s->element(track));
if (!cr)
continue;
if (cr->isChord()) {
for (Note* n : toChord(cr)->notes())
width = qMax(width, n->shape().right() + n->pos().x() + cr->pos().x());
}
else if (cr->isRest() && (cr->actualDurationType() != TDuration::DurationType::V_MEASURE))
width = qMax(width, cr->bbox().right() + cr->pos().x());
}

x = width + sp;

// extend past chord/rest
Expand Down

0 comments on commit 92d8c61

Please sign in to comment.