From 215c260c9e1e1264c003ff91ce9547660a576b43 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 30 Jun 2015 17:08:43 -0700 Subject: [PATCH] Fix TextOverlay font size setting --- interface/src/ui/overlays/TextOverlay.cpp | 7 +++++++ interface/src/ui/overlays/TextOverlay.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index ccad3bd295..174f8e05dc 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -170,3 +170,10 @@ QSizeF TextOverlay::textSize(const QString& text) const { return QSizeF(extents.x, extents.y); } + +void TextOverlay::setFontSize(int fontSize) { + _fontSize = fontSize; + + delete _textRenderer; + _textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, _fontSize, DEFAULT_FONT_WEIGHT); +} diff --git a/interface/src/ui/overlays/TextOverlay.h b/interface/src/ui/overlays/TextOverlay.h index de2597cf9a..32786c3220 100644 --- a/interface/src/ui/overlays/TextOverlay.h +++ b/interface/src/ui/overlays/TextOverlay.h @@ -48,7 +48,7 @@ public: void setText(const QString& text) { _text = text; } void setLeftMargin(int margin) { _leftMargin = margin; } void setTopMargin(int margin) { _topMargin = margin; } - void setFontSize(int fontSize) { _fontSize = fontSize; } + void setFontSize(int fontSize); virtual void setProperties(const QScriptValue& properties); virtual TextOverlay* createClone() const;