Lines Matching refs:child
52 /* if total length of children is too long or only one child, layout them centerly no matter what key word set.
100 UIView* child = childrenHead_;
107 while (child != nullptr) {
108 if (child->IsVisible()) {
109 child->ReMeasure();
111 left = child->GetStyle(STYLE_MARGIN_LEFT);
112 right = child->GetStyle(STYLE_MARGIN_RIGHT);
113 totalValidLength += (child->GetRelativeRect().GetWidth() + left + right);
115 top = child->GetStyle(STYLE_MARGIN_TOP);
116 bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
117 totalValidLength += (child->GetRelativeRect().GetHeight() + top + bottom);
121 child = child->GetNextSibling();
127 UIView* child = childrenHead_;
133 while (child != nullptr) {
134 if (child->IsVisible()) {
135 child->ReMeasure();
136 left = child->GetStyle(STYLE_MARGIN_LEFT);
137 right = child->GetStyle(STYLE_MARGIN_RIGHT);
139 if ((pos + child->GetRelativeRect().GetWidth() + right) > GetWidth()) {
143 pos += child->GetRelativeRect().GetWidth() + right;
145 child = child->GetNextSibling();
151 UIView* child = childrenHead_;
164 while (child != nullptr) {
165 if (child->IsVisible()) {
166 left = child->GetStyle(STYLE_MARGIN_LEFT);
167 right = child->GetStyle(STYLE_MARGIN_RIGHT);
168 top = child->GetStyle(STYLE_MARGIN_TOP);
169 bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
171 if ((pos + child->GetRelativeRect().GetWidth() + right) > GetWidth()) {
177 height = MATH_MAX(height, child->GetRelativeRect().GetHeight() + top + bottom);
179 pos += child->GetRelativeRect().GetWidth() + right;
181 child = child->GetNextSibling();
187 UIView* child = childrenHead_;
199 while (child != nullptr) {
200 if (child->IsVisible()) {
201 left = child->GetStyle(STYLE_MARGIN_LEFT);
202 right = child->GetStyle(STYLE_MARGIN_RIGHT);
204 if ((pos + child->GetRelativeRect().GetWidth() + right) > GetWidth()) {
212 width += child->GetRelativeRect().GetWidth() + right + left;
216 pos += child->GetRelativeRect().GetWidth() + right;
218 child = child->GetNextSibling();
222 void FlexLayout::GetCrossAxisPosY(int16_t& posY, uint16_t& count, uint16_t* rowsMaxHeight, UIView* child)
224 if ((rowsMaxHeight == nullptr) || (child == nullptr)) {
230 int16_t top = child->GetStyle(STYLE_MARGIN_TOP);
231 int16_t bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
242 posY = GetHeight() - child->GetRelativeRect().GetHeight() - bottom - offset;
251 posY = (GetHeight() - child->GetRelativeRect().GetHeight() - top - bottom) / 2 + top + offset; // 2: half
257 UIView* child = childrenHead_;
285 while (child != nullptr) {
286 if (child->IsVisible()) {
287 int16_t left = child->GetStyle(STYLE_MARGIN_LEFT);
288 int16_t right = child->GetStyle(STYLE_MARGIN_RIGHT);
290 if (((posX + child->GetRelativeRect().GetWidth() + right) > GetWidth()) && (wrap_ == WRAP)) {
295 GetCrossAxisPosY(posY, count, rowsMaxHeight, child);
297 child->SetPosition(GetWidth() - posX - child->GetRelativeRect().GetWidth() - right,
298 posY - child->GetStyle(STYLE_MARGIN_TOP));
300 child->SetPosition(posX - left, posY - child->GetStyle(STYLE_MARGIN_TOP));
302 posX += child->GetRelativeRect().GetWidth() + right + interval;
303 child->LayoutChildren();
305 child = child->GetNextSibling();
317 UIView* child = childrenHead_;
323 while (child != nullptr) {
324 if (child->IsVisible()) {
325 child->ReMeasure();
326 top = child->GetStyle(STYLE_MARGIN_TOP);
327 bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
329 if ((pos + child->GetRelativeRect().GetHeight() + bottom) > GetHeight()) {
333 pos += child->GetRelativeRect().GetHeight() + bottom;
335 child = child->GetNextSibling();
341 UIView* child = childrenHead_;
353 while (child != nullptr) {
354 if (child->IsVisible()) {
355 left = child->GetStyle(STYLE_MARGIN_LEFT);
356 right = child->GetStyle(STYLE_MARGIN_RIGHT);
357 bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
359 if ((pos + child->GetRelativeRect().GetHeight() + bottom) > GetHeight()) {
365 width = MATH_MAX(width, child->GetRelativeRect().GetWidth() + left + right);
367 pos += child->GetRelativeRect().GetHeight() + bottom;
369 child = child->GetNextSibling();
375 UIView* child = childrenHead_;
387 while (child != nullptr) {
388 if (child->IsVisible()) {
389 top = child->GetStyle(STYLE_MARGIN_TOP);
390 bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
392 if ((pos + child->GetRelativeRect().GetHeight() + bottom) > GetHeight()) {
400 height += child->GetRelativeRect().GetHeight() + top + bottom;
404 pos += child->GetRelativeRect().GetHeight() + bottom;
406 child = child->GetNextSibling();
410 void FlexLayout::GetCrossAxisPosX(int16_t& posX, uint16_t& count, uint16_t* columnsMaxWidth, UIView* child)
412 if ((columnsMaxWidth == nullptr) || (child == nullptr)) {
418 int16_t left = child->GetStyle(STYLE_MARGIN_LEFT);
419 int16_t right = child->GetStyle(STYLE_MARGIN_RIGHT);
430 posX = GetWidth() - child->GetRelativeRect().GetWidth() - right - offset;
439 posX = (GetWidth() - child->GetRelativeRect().GetWidth() - left - right) / 2 + left + offset; // 2: half
445 UIView* child = childrenHead_;
473 while (child != nullptr) {
474 if (child->IsVisible()) {
475 int16_t top = child->GetStyle(STYLE_MARGIN_TOP);
476 int16_t bottom = child->GetStyle(STYLE_MARGIN_BOTTOM);
478 if (((posY + child->GetRelativeRect().GetHeight() + bottom) > GetHeight()) && (wrap_ == WRAP)) {
483 GetCrossAxisPosX(posX, count, columnsMaxWidth, child);
485 child->SetPosition(posX - child->GetStyle(STYLE_MARGIN_LEFT),
486 GetHeight() - posY - child->GetRelativeRect().GetHeight() - bottom);
488 child->SetPosition(posX - child->GetStyle(STYLE_MARGIN_LEFT), posY - top);
490 posY += child->GetRelativeRect().GetHeight() + bottom + interval;
491 child->LayoutChildren();
493 child = child->GetNextSibling();