From 24643ca282f2d4a9c88125b4d2a3c3fba1460cff Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Fri, 17 Jul 2015 14:19:39 -0700 Subject: [PATCH] Working on line spacing --- interface/resources/qml/TextOverlayElement.qml | 2 ++ interface/src/ui/overlays/TextOverlay.cpp | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/TextOverlayElement.qml b/interface/resources/qml/TextOverlayElement.qml index 56309e5391..ac17468c07 100644 --- a/interface/resources/qml/TextOverlayElement.qml +++ b/interface/resources/qml/TextOverlayElement.qml @@ -16,6 +16,8 @@ TextOverlayElement { color: root.textColor font.family: root.fontFamily font.pixelSize: root.fontSize + lineHeightMode: Text.FixedHeight + lineHeight: root.fontSize * 1.2 } } } diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index e33c18face..5507ef38ac 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -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); }