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