mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:43:03 +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
|
color: root.textColor
|
||||||
font.family: root.fontFamily
|
font.family: root.fontFamily
|
||||||
font.pixelSize: root.fontSize
|
font.pixelSize: root.fontSize
|
||||||
|
lineHeightMode: Text.FixedHeight
|
||||||
|
lineHeight: root.fontSize * 1.2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,12 +236,9 @@ QSizeF TextOverlay::textSize(const QString& text) const {
|
||||||
++lines;
|
++lines;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
QFontMetrics fm(QFont(SANS_FONT_FAMILY, _fontSize * 1.2));
|
|
||||||
#else
|
|
||||||
QFontMetrics fm(QFont(SANS_FONT_FAMILY, _fontSize));
|
QFontMetrics fm(QFont(SANS_FONT_FAMILY, _fontSize));
|
||||||
#endif
|
|
||||||
QSizeF result = QSizeF(fm.width(text), fm.lineSpacing() * lines);
|
QSizeF result = QSizeF(fm.width(text), fm.lineSpacing() * lines);
|
||||||
|
result.rheight() *= 1.2;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,6 +249,7 @@ void TextOverlay::setFontSize(int fontSize) {
|
||||||
|
|
||||||
void TextOverlay::setText(const QString& text) {
|
void TextOverlay::setText(const QString& text) {
|
||||||
_text = text;
|
_text = text;
|
||||||
|
qDebug() << text;
|
||||||
_qmlElement->settext(text);
|
_qmlElement->settext(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue