Skip to content

Commit

Permalink
Slightly alter the position of one-note tremolo strokes to make them …
Browse files Browse the repository at this point in the history
…look better
  • Loading branch information
Harmoniker1 committed Jul 7, 2020
1 parent 408f620 commit 378af09
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libmscore/tremolo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,20 @@ void Tremolo::layoutOneNoteTremolo(qreal x, qreal y, qreal spatium)
int line = up ? chord()->upLine() : chord()->downLine();

if (!placeMidStem()) {
const qreal offset = 2.0 * score()->styleD(Sid::tremoloStrokeWidth);

qreal t = 0.0;
// nearest distance between note and tremolo stroke should be no less than 3.0
if (chord()->hook() || chord()->beam()) {
t = up ? -3.0 - 2.0 * minHeight() : 3.0;
}
else {
if (!up && !(line & 1)) // stem is down; even line
t = qMax(6.0 - 2.0 * minHeight(), 3.0);
t = qMax(4.0 + offset - 2.0 * minHeight(), 3.0);
else if (!up && (line & 1)) // stem is down; odd line
t = qMax(5.0 - 2.0 * minHeight(), 3.0);
t = qMax(5.0 - 2.0 * minHeight() , 3.0);
else if ( up && !(line & 1)) // stem is up; even line
t = qMin(-3.0 - 2.0 * minHeight(), -6.0);
t = qMin(-3.0 - 2.0 * minHeight(), -4.0 - offset);
else /*if ( up && (line & 1))*/ // stem is up; odd line
t = qMin(-3.0 - 2.0 * minHeight(), -5.0);
}
Expand Down

0 comments on commit 378af09

Please sign in to comment.