mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
Working on line spacing
This commit is contained in:
parent
6f998e5d28
commit
24643ca282
2 changed files with 4 additions and 4 deletions
|
@ -16,6 +16,8 @@ TextOverlayElement {
|
|||
color: root.textColor
|
||||
font.family: root.fontFamily
|
||||
font.pixelSize: root.fontSize
|
||||
lineHeightMode: Text.FixedHeight
|
||||
lineHeight: root.fontSize * 1.2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue