MCPcopy Create free account
hub / github.com/SFML/SFML / update

Method update

examples/text/Text.cpp:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void update()
125 {
126 // Update text bounding box
127 const auto localBounds = text.getLocalBounds();
128 boundingBox.setPosition(text.getPosition() + localBounds.position);
129 boundingBox.setSize(localBounds.size);
130
131 // Position the glyph bounding box and cursor
132 updateGlyphBox(0);
133 computeCursorPositions();
134 updateCursorPosition(0);
135
136 // Update rainbow text default y positions
137 const auto& vertexData = text.getVertexData();
138 rainbowYPositions.resize(vertexData.getVertexCount());
139 std::transform(vertexData.begin(),
140 vertexData.end(),
141 rainbowYPositions.begin(),
142 [](const sf::Vertex& vertex) { return vertex.position.y; });
143 }
144
145 void updateGlyphBox(int offset)
146 {

Callers

nothing calls this directly

Calls 8

getLocalBoundsMethod · 0.45
setPositionMethod · 0.45
getPositionMethod · 0.45
setSizeMethod · 0.45
resizeMethod · 0.45
getVertexCountMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected