fix #40301: ties can overlap staff lines
Merge pull request #1488 from MarcSabatella/40301-tie-staff-line

fix #40301: ties can overlap staff lines