diff options
author | 2017-03-29 17:09:40 +0200 | |
---|---|---|
committer | 2017-03-29 17:09:40 +0200 | |
commit | 49f7c99c7786ce257fae28dfeae2f8ee5810424c (patch) | |
tree | 1bbd30dd4dd48596186846c2fc77a8dc748215d2 /3rdparty/bgfx/examples/common/font/text_metrics.cpp | |
parent | 79f22e060b2c012d628d5d1d83288c1bb6e6acef (diff) |
Update BGFX and BX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/font/text_metrics.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/font/text_metrics.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/3rdparty/bgfx/examples/common/font/text_metrics.cpp b/3rdparty/bgfx/examples/common/font/text_metrics.cpp index 768ebbdac4c..835c9e14187 100644 --- a/3rdparty/bgfx/examples/common/font/text_metrics.cpp +++ b/3rdparty/bgfx/examples/common/font/text_metrics.cpp @@ -10,12 +10,13 @@ TextMetrics::TextMetrics(FontManager* _fontManager) : m_fontManager(_fontManager) - , m_width(0) - , m_height(0) - , m_x(0) - , m_lineHeight(0) - , m_lineGap(0) { + clearText(); +} + +void TextMetrics::clearText() +{ + m_width = m_height = m_x = m_lineHeight = m_lineGap = 0; } void TextMetrics::appendText(FontHandle _fontHandle, const char* _string) @@ -50,7 +51,6 @@ void TextMetrics::appendText(FontHandle _fontHandle, const char* _string) m_lineGap = font.lineGap; m_lineHeight = font.ascender - font.descender; m_x = 0; - break; } m_x += glyph->advance_x; @@ -97,7 +97,6 @@ void TextMetrics::appendText(FontHandle _fontHandle, const wchar_t* _string) m_lineGap = font.lineGap; m_lineHeight = font.ascender - font.descender; m_x = 0; - break; } m_x += glyph->advance_x; |