| 191 | } |
| 192 | |
| 193 | Vector2f FormattedTextBlock::MeasureSize(Vector2f proposedSize) |
| 194 | { |
| 195 | if (_parts.empty() || _proposedWidth != proposedSize.X) { |
| 196 | _proposedWidth = proposedSize.X; |
| 197 | RecreateCache(); |
| 198 | } |
| 199 | |
| 200 | std::int32_t cachedHeight = GetCachedHeight(); |
| 201 | if (cachedHeight <= 0) { |
| 202 | return {}; |
| 203 | } |
| 204 | |
| 205 | return Vector2f(_cachedWidth, cachedHeight); |
| 206 | } |
| 207 | |
| 208 | float FormattedTextBlock::GetCachedWidth() const |
| 209 | { |
no test coverage detected