Skip to content

Commit

Permalink
Merge pull request #19558 from miiizen/19488-notehead-offset
Browse files Browse the repository at this point in the history
factor notehead offset into stem length calculations
  • Loading branch information
cbjeukendrup committed Oct 5, 2023
2 parents 7e1af51 + a1ff998 commit 339ab2b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/engraving/dom/chord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ double Chord::calcDefaultStemLength()
// when the chord's magnitude is < 1, the stem length with mag can find itself below the middle line.
// in those cases, we have to add the extra amount to it to bring it to a minimum.
double upValue = m_up ? -1. : 1.;
double stemStart = startNote->pos().y();
double stemStart = startNote->ldata()->pos().y();
double stemEndMag = stemStart + (finalStemLength * upValue);
double topLine = 0.0;
lineDistance *= _spatium;
Expand Down
2 changes: 1 addition & 1 deletion src/engraving/rendering/dev/beamtremololayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ double BeamTremoloLayout::chordBeamAnchorY(const ChordRest* cr) const
return y + chord->pagePos().y();
}

return position.y() + (chord->defaultStemLength() * upValue) - beamOffset;
return position.y() - note->offset().y() + (chord->defaultStemLength() * upValue) - beamOffset;
}

PointF BeamTremoloLayout::chordBeamAnchor(const ChordRest* cr, ChordBeamAnchorType anchorType) const
Expand Down
Binary file added vtest/scores/notehead-offset.mscz
Binary file not shown.

0 comments on commit 339ab2b

Please sign in to comment.