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

Method updateTextAndGeometry

extlibs/sfe/src/RichText.cpp:88–97  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

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