Merge pull request #17386 from mikekirin/stretched-bends-fix

src position fix when deleting bend segment
This commit is contained in:
mikekirin 2023-04-28 16:27:41 +02:00 committed by GitHub
commit 6b193674e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -119,11 +119,10 @@ void StretchedBend::fillSegments()
}
bool isPrevBendUp = false;
PointF upBendDefaultSrc = PointF(m_noteWidth + m_spatium * .8, 0);
PointF downBendDefaultSrc = PointF(m_noteWidth * .5, -m_noteHeight * .5 - m_spatium * .2);
PointF src = (m_drawPoints[0] == 0)
? PointF(m_noteWidth + m_spatium * .8, 0)
: PointF(m_noteWidth * .5, -m_noteHeight * .5 - m_spatium * .2);
PointF src = m_drawPoints[0] == 0 ? upBendDefaultSrc : downBendDefaultSrc;
PointF dest(0, 0);
int lastPointPitch = m_drawPoints.back();
@ -167,8 +166,8 @@ void StretchedBend::fillSegments()
} else if (prevBendPitch > 0 && prevBendPitch < pitch) {
m_bendSegments.back().tone = bendTone(0);
}
// We need to reset the y position in case we remove or change prev bend
src.ry() = 0;
// We need to reset the src position in case we remove or change prev bend
src = upBendDefaultSrc;
}
isPrevBendUp = bendUp;