MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / updateTextAndGeometry

Method updateTextAndGeometry

src/Core/Graphics/Text.cpp:83–92  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

81
82 ////////////////////////////////////////////////////////////////////////////////
83 void RichText::Line::updateTextAndGeometry(sf::Text& text) const
84 {
85 // Set text offset
86 text.setPosition(m_bounds.width, 0.f);
87
88 // Update bounds
89 const int lineSpacing = text.getFont()->getLineSpacing(text.getCharacterSize());
90 m_bounds.height = std::max(m_bounds.height, static_cast<float>(lineSpacing));
91 m_bounds.width += text.getGlobalBounds().width;
92 }
93
94 ////////////////////////////////////////////////////////////////////////////////
95 RichText::RichText()

Callers

nothing calls this directly

Calls 4

setPositionMethod · 0.45
getFontMethod · 0.45
getCharacterSizeMethod · 0.45
getGlobalBoundsMethod · 0.45

Tested by

no test coverage detected