MCPcopy Create free account
hub / github.com/Snapchat/Valdi / measure

Method measure

third-party/yoga/src/yoga/node/Node.cpp:54–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54YGSize Node::measure(
55 float availableWidth,
56 MeasureMode widthMode,
57 float availableHeight,
58 MeasureMode heightMode) {
59 const auto size = measureFunc_(
60 this,
61 availableWidth,
62 unscopedEnum(widthMode),
63 availableHeight,
64 unscopedEnum(heightMode));
65
66 if (yoga::isUndefined(size.height) || size.height < 0 ||
67 yoga::isUndefined(size.width) || size.width < 0) {
68 yoga::log(
69 this,
70 LogLevel::Warn,
71 "Measure function returned an invalid dimension to Yoga: [width=%f, height=%f]",
72 size.width,
73 size.height);
74 return {
75 .width = maxOrDefined(0.0f, size.width),
76 .height = maxOrDefined(0.0f, size.height)};
77 }
78
79 return size;
80}
81
82float Node::baseline(float width, float height) const {
83 return baselineFunc_(this, width, height);

Callers

nothing calls this directly

Calls 4

unscopedEnumFunction · 0.50
isUndefinedFunction · 0.50
logFunction · 0.50
maxOrDefinedFunction · 0.50

Tested by

no test coverage detected