BsGUISpace.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "BsGUISpace.h"
  2. namespace BansheeEngine
  3. {
  4. GUIFixedSpace::~GUIFixedSpace()
  5. {
  6. if (mParentElement != nullptr)
  7. mParentElement->_unregisterChildElement(this);
  8. }
  9. LayoutSizeRange GUIFixedSpace::_calculateLayoutSizeRange() const
  10. {
  11. LayoutSizeRange range;
  12. range.optimal = _getOptimalSize();
  13. range.min = range.optimal;
  14. range.max = range.optimal;
  15. return range;
  16. }
  17. GUIFixedSpace* GUIFixedSpace::create(UINT32 size)
  18. {
  19. return bs_new<GUIFixedSpace>(size);
  20. }
  21. void GUIFixedSpace::destroy(GUIFixedSpace* space)
  22. {
  23. bs_delete(space);
  24. }
  25. GUIFlexibleSpace::~GUIFlexibleSpace()
  26. {
  27. if (mParentElement != nullptr)
  28. mParentElement->_unregisterChildElement(this);
  29. }
  30. LayoutSizeRange GUIFlexibleSpace::_calculateLayoutSizeRange() const
  31. {
  32. LayoutSizeRange range;
  33. range.optimal = _getOptimalSize();
  34. range.min = range.optimal;
  35. range.max = range.optimal;
  36. return range;
  37. }
  38. GUIFlexibleSpace* GUIFlexibleSpace::create()
  39. {
  40. return bs_new<GUIFlexibleSpace>();
  41. }
  42. void GUIFlexibleSpace::destroy(GUIFlexibleSpace* space)
  43. {
  44. bs_delete(space);
  45. }
  46. }