Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factor notehead offset into stem length calculations #19558

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.