Skip to content

Commit

Permalink
Merge pull request #3697 from rism-digital/develop-beam-glyph-pos
Browse files Browse the repository at this point in the history
Take into account the glyph anchors in beams
  • Loading branch information
lpugin authored Jun 2, 2024
2 parents 7829847 + 017c51d commit 1994857
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1882,9 +1882,16 @@ void BeamElementCoord::SetDrawingStemDir(data_STEMDIRECTION stemDir, const Staff

m_stem->SetDrawingStemDir(stemDir);
m_yBeam = m_element->GetDrawingY();
m_x += (STEMDIRECTION_up == stemDir)
? 2 * m_element->GetDrawingRadius(doc) - doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2
: doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2;

// Move and take into account the glyph cut-outs
if (STEMDIRECTION_up == stemDir) {
m_x += stemInterface->GetStemUpSE(doc, staff->m_drawingStaffSize, interface->m_cueSize).x;
m_x -= doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2;
}
else {
m_x += stemInterface->GetStemDownNW(doc, staff->m_drawingStaffSize, interface->m_cueSize).x;
m_x += doc->GetDrawingStemWidth(staff->m_drawingStaffSize) / 2;
}

if (m_tabDurSym && !m_closestNote) {
m_yBeam = m_tabDurSym->GetDrawingY();
Expand Down

0 comments on commit 1994857

Please sign in to comment.