Skip to content

Commit

Permalink
fix #146991 detached stem after fix notes to line
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed Nov 12, 2018
1 parent 98121ca commit b64b60a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion libmscore/layout.cpp
Expand Up @@ -841,7 +841,12 @@ void Score::layoutChords3(std::vector<Note*>& notes, const Staff* staff, Segment
else if (_up)
x = chord->stemPosX() - note->headBodyWidth();

note->rypos() = (note->line() + stepOffset) * stepDistance;
qreal ny = (note->line() + stepOffset) * stepDistance;
if (note->rypos() != ny) {
note->rypos() = ny;
if (chord->stem())
chord->stem()->layout();

This comment has been minimized.

Copy link
@MarcSabatella

MarcSabatella Dec 18, 2018

Contributor

At this point we need to recalculate hook position as well. Unfortunately, hook()->layout() doesn't do that; the code that does seems a bit scattered and I'm not sure the best way to do it here.

}
note->rxpos() = x;

// find leftmost non-mirrored note to set as X origin for accidental layout
Expand Down
2 changes: 1 addition & 1 deletion libmscore/stem.cpp
Expand Up @@ -152,7 +152,7 @@ void Stem::draw(QPainter* painter) const

const Staff* st = staff();
const StaffType* stt = st ? st->staffType(chord()->tick()) : 0;
bool useTab = stt && stt->isTabStaff();
bool useTab = stt && stt->isTabStaff();

painter->setPen(QPen(curColor(), _lineWidth, Qt::SolidLine, Qt::RoundCap));
painter->drawLine(line);
Expand Down

0 comments on commit b64b60a

Please sign in to comment.