Skip to content

Commit

Permalink
Prevent beamed stems extending
Browse files Browse the repository at this point in the history
  • Loading branch information
miiizen committed Oct 2, 2023
1 parent 8cc78cf commit d7e8ccd
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() - startNote->offset().y();
double stemStart = startNote->layoutData()->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 modified vtest/scores/notehead-offset.mscz
Binary file not shown.

0 comments on commit d7e8ccd

Please sign in to comment.