new function TextMetrics::clearText() (#1046)

This commit is contained in:
Libor Čapák 2017-02-13 22:27:07 +01:00 committed by Branimir Karadžić
parent d72aff9e5d
commit b0eac0a809
2 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -25,6 +25,9 @@ public:
/// Return the height of the measured text.
float getHeight() const { return m_height; }
/// Clear the width and height of the measured text.
void clearText();
private:
FontManager* m_fontManager;
float m_width;