MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / MeasureSize

Method MeasureSize

Sources/Jazz2/UI/FormattedTextBlock.cpp:193–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

OnDrawMethod · 0.80
OnDrawClippedMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected