AbsoluteLayout.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "Base.h"
  2. #include "Control.h"
  3. #include "AbsoluteLayout.h"
  4. #include "Container.h"
  5. namespace gameplay
  6. {
  7. AbsoluteLayout::AbsoluteLayout()
  8. {
  9. }
  10. AbsoluteLayout::AbsoluteLayout(const AbsoluteLayout& copy)
  11. {
  12. }
  13. AbsoluteLayout::~AbsoluteLayout()
  14. {
  15. }
  16. AbsoluteLayout* AbsoluteLayout::create()
  17. {
  18. AbsoluteLayout* al = new AbsoluteLayout();
  19. return al;
  20. }
  21. Layout::Type AbsoluteLayout::getType()
  22. {
  23. return Layout::LAYOUT_ABSOLUTE;
  24. }
  25. void AbsoluteLayout::update(const Container* container)
  26. {
  27. // An AbsoluteLayout does nothing to modify the layout of Controls.
  28. std::vector<Control*> controls = container->getControls();
  29. unsigned int controlsCount = controls.size();
  30. for (unsigned int i = 0; i < controlsCount; i++)
  31. {
  32. if (controls[i]->isDirty())
  33. {
  34. controls[i]->update(container->getClip());
  35. }
  36. }
  37. }
  38. }