| 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 | { |
nothing calls this directly
no test coverage detected