Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/rendering/StarTextPainter.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-21 20:40:40 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-21 20:40:40 +1000
commit865f9a328a9068c9917c52c387f27b3e102712bc (patch)
tree786b7ab4e996c0753a9d66ad0d56e9a3bde20254 /source/rendering/StarTextPainter.cpp
parent320428eddfb60ce16f1e1241ccb7ae397c908b9b (diff)
Fix glyph width issue with custom fonts
haha woopsies!!
Diffstat (limited to 'source/rendering/StarTextPainter.cpp')
-rw-r--r--source/rendering/StarTextPainter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/rendering/StarTextPainter.cpp b/source/rendering/StarTextPainter.cpp
index f3efe51..fbfe3b5 100644
--- a/source/rendering/StarTextPainter.cpp
+++ b/source/rendering/StarTextPainter.cpp
@@ -388,6 +388,7 @@ RectF TextPainter::doRenderLine(String const& s, TextPositioning const& position
RectF TextPainter::doRenderGlyph(String::Char c, TextPositioning const& position, bool reallyRender) {
if (m_nonRenderedCharacters.find(String(c)) != NPos)
return RectF();
+ setFont(m_renderSettings.font);
int width = glyphWidth(c);
// Offset left by width if right anchored.
float hOffset = 0;
@@ -403,7 +404,6 @@ RectF TextPainter::doRenderGlyph(String::Char c, TextPositioning const& position
vOffset = -(float)m_fontSize;
if (reallyRender) {
- setFont(m_renderSettings.font);
if ((int)m_renderSettings.mode & (int)FontMode::Shadow) {
Color shadow = Color::Black;
uint8_t alphaU = m_renderSettings.color[3];