2
0

UIVerticalStack.cpp 537 B

123456789101112131415161718192021222324
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #include <TestFramework.h>
  4. #include <UI/UIVerticalStack.h>
  5. JPH_IMPLEMENT_RTTI_VIRTUAL(UIVerticalStack)
  6. {
  7. JPH_ADD_BASE_CLASS(UIVerticalStack, UIElement)
  8. }
  9. void UIVerticalStack::AutoLayout()
  10. {
  11. UIElement::AutoLayout();
  12. mHeight.Set(0, PIXELS);
  13. for (UIElement *e : mChildren)
  14. if (e->IsVisible() || mPlaceInvisibleChildren)
  15. {
  16. e->SetRelativeY(GetHeight());
  17. mHeight.Set(GetHeight() + e->GetHeight() + e->GetPaddingBottom() + mDeltaY, PIXELS);
  18. }
  19. }