2
0

UIVerticalStack.cpp 601 B

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