| 1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
|---|---|
| 2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
| 3 | #include "GUI/BsGUISpace.h" |
| 4 | |
| 5 | namespace bs |
| 6 | { |
| 7 | GUIFixedSpace::~GUIFixedSpace() |
| 8 | { |
| 9 | if (mParentElement != nullptr) |
| 10 | mParentElement->_unregisterChildElement(this); |
| 11 | } |
| 12 | |
| 13 | LayoutSizeRange GUIFixedSpace::_calculateLayoutSizeRange() const |
| 14 | { |
| 15 | LayoutSizeRange range; |
| 16 | range.optimal = _getOptimalSize(); |
| 17 | range.min = range.optimal; |
| 18 | range.max = range.optimal; |
| 19 | |
| 20 | return range; |
| 21 | } |
| 22 | |
| 23 | GUIFixedSpace* GUIFixedSpace::create(UINT32 size) |
| 24 | { |
| 25 | return bs_new<GUIFixedSpace>(size); |
| 26 | } |
| 27 | |
| 28 | void GUIFixedSpace::destroy(GUIFixedSpace* space) |
| 29 | { |
| 30 | bs_delete(space); |
| 31 | } |
| 32 | |
| 33 | GUIFlexibleSpace::~GUIFlexibleSpace() |
| 34 | { |
| 35 | if (mParentElement != nullptr) |
| 36 | mParentElement->_unregisterChildElement(this); |
| 37 | } |
| 38 | |
| 39 | LayoutSizeRange GUIFlexibleSpace::_calculateLayoutSizeRange() const |
| 40 | { |
| 41 | LayoutSizeRange range; |
| 42 | range.optimal = _getOptimalSize(); |
| 43 | range.min = range.optimal; |
| 44 | range.max = range.optimal; |
| 45 | |
| 46 | return range; |
| 47 | } |
| 48 | |
| 49 | GUIFlexibleSpace* GUIFlexibleSpace::create() |
| 50 | { |
| 51 | return bs_new<GUIFlexibleSpace>(); |
| 52 | } |
| 53 | |
| 54 | void GUIFlexibleSpace::destroy(GUIFlexibleSpace* space) |
| 55 | { |
| 56 | bs_delete(space); |
| 57 | } |
| 58 | } |