Skip to content

Commit

Permalink
fix trill rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
wschweer committed May 7, 2015
1 parent 64d9689 commit f6b88f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmscore/sym.h
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,6 @@ inline uint qHash(const GlyphKey& k)
return (int(k.id) << 16) + int(k.mag*1000);
}


//---------------------------------------------------------
// ScoreFont
//---------------------------------------------------------
Expand Down Expand Up @@ -2599,6 +2598,7 @@ class ScoreFont {

qreal height(SymId id, qreal mag) const { return sym(id).bbox().height() * mag; }
qreal width(SymId id, qreal mag) const { return sym(id).bbox().width() * mag; }
qreal advance(SymId id, qreal mag) const { return sym(id).advance() * mag; }
qreal width(const QList<SymId>&, qreal mag) const;

const QRectF bbox(SymId id, qreal mag) const;
Expand Down
6 changes: 4 additions & 2 deletions libmscore/trill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ void TrillSegment::symbolLine(SymId start, SymId fill)

_symbols.clear();
_symbols.append(start);
qreal w1 = f->bbox(start, mag).width();
qreal w2 = f->width(fill, mag);
// qreal w1 = f->bbox(start, mag).width();
// qreal w2 = f->width(fill, mag);
qreal w1 = f->advance(start, mag);
qreal w2 = f->advance(fill, mag);
int n = lrint((w - w1) / w2);
for (int i = 0; i < n; ++i)
_symbols.append(fill);
Expand Down

0 comments on commit f6b88f1

Please sign in to comment.