mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 09:33:45 +02:00
Merge pull request #5240 from ctrlaltdavid/fix-textoverlay-size
Fix TextOverlay font size setting
This commit is contained in:
commit
ede2eec283
2 changed files with 9 additions and 1 deletions
|
@ -170,3 +170,11 @@ QSizeF TextOverlay::textSize(const QString& text) const {
|
|||
|
||||
return QSizeF(extents.x, extents.y);
|
||||
}
|
||||
|
||||
void TextOverlay::setFontSize(int fontSize) {
|
||||
_fontSize = fontSize;
|
||||
|
||||
auto oldTextRenderer = _textRenderer;
|
||||
_textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, _fontSize, DEFAULT_FONT_WEIGHT);
|
||||
delete oldTextRenderer;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue