Working on line spacing

This commit is contained in:
Bradley Austin Davis 2015-07-17 14:19:39 -07:00
parent 6f998e5d28
commit 24643ca282
2 changed files with 4 additions and 4 deletions

View file

@ -16,6 +16,8 @@ TextOverlayElement {
color: root.textColor
font.family: root.fontFamily
font.pixelSize: root.fontSize
lineHeightMode: Text.FixedHeight
lineHeight: root.fontSize * 1.2
}
}
}

View file

@ -236,12 +236,9 @@ QSizeF TextOverlay::textSize(const QString& text) const {
++lines;
}
}
#ifdef Q_OS_MAC
QFontMetrics fm(QFont(SANS_FONT_FAMILY, _fontSize * 1.2));
#else
QFontMetrics fm(QFont(SANS_FONT_FAMILY, _fontSize));
#endif
QSizeF result = QSizeF(fm.width(text), fm.lineSpacing() * lines);
result.rheight() *= 1.2;
return result;
}
@ -252,6 +249,7 @@ void TextOverlay::setFontSize(int fontSize) {
void TextOverlay::setText(const QString& text) {
_text = text;
qDebug() << text;
_qmlElement->settext(text);
}