Skip to content

Commit

Permalink
fix #119381: Scaling of fretboard chord diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Jul 26, 2016
1 parent b38ac07 commit fab2e3d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libmscore/fret.cpp
Expand Up @@ -286,8 +286,10 @@ void FretDiagram::draw(QPainter* painter) const
qreal y = fretDist * i;
painter->drawLine(QLineF(0.0, y, x2, y));
}
painter->setFont(font);
QFontMetricsF fm(font);
QFont scaledFont(font);
scaledFont.setPixelSize(font.pixelSize() * _userMag);
painter->setFont(scaledFont);
QFontMetricsF fm(scaledFont);
qreal dotd = stringDist * .6;

for (int i = 0; i < _strings; ++i) {
Expand Down Expand Up @@ -358,7 +360,9 @@ void FretDiagram::layout()
qreal x = -((dotd+lw1) * .5);
w += dotd + lw1;
if (_marker) {
QFontMetricsF fm(font);
QFont scaledFont(font);
scaledFont.setPixelSize(font.pixelSize() * _userMag);
QFontMetricsF fm(scaledFont);
y = -(fretDist * .1 + fm.height());
h -= y;
}
Expand Down

0 comments on commit fab2e3d

Please sign in to comment.