Go to the documentation of this file.
17#define COMPONENT_COMPUTE_DIMENSION(type, dimension, dependency, axis, children, enabledValue, addition) \
18 if (enabledValue != Sgl::Component::USE_COMPUTED_SIZE) { return enabledValue; } \
20 int32_t min##axis = INT32_MAX; \
21 int32_t max##axis = 0; \
22 for (const Component* child : children) \
24 int32_t child##axis = child->getLayout##axis(); \
25 int32_t child##dimension = child->compute##type##dimension(dependency); \
27 if (child##dimension == Sgl::Component::UNLIMITED_SIZE) \
29 return Sgl::Component::UNLIMITED_SIZE; \
32 min##axis = std::min(min##axis, child##axis); \
33 max##axis = std::max(max##axis, child##axis + child##dimension); \
36 if (min##axis != INT32_MAX) \
38 return max##axis + addition; \