Skip to content

Commit

Permalink
fix #40301: ties can overlap staff lines
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSabatella committed Nov 30, 2014
1 parent 9b2266e commit 83e26d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libmscore/slur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ void SlurSegment::layout(const QPointF& p1, const QPointF& p2)
if (bbox.height() < minDistance * 2 * sp && st) {
// slur/tie is fairly flat
bool up = slurTie()->up();
qreal staffY = system()->staff(staffIdx())->y();
qreal ld = st->lineDistance() * sp;
qreal topY = (bbox.top() - staffY) / ld;
qreal bottomY = (bbox.bottom() - staffY) / ld;
qreal topY = bbox.top() / ld;
qreal bottomY = bbox.bottom() / ld;
int lineY = up ? qRound(topY) : qRound(bottomY);
if (lineY >= 0 && lineY < st->lines() * st->lineDistance()) {
// on staff
Expand Down

0 comments on commit 83e26d8

Please sign in to comment.