diff options
author | crupest <crupest@outlook.com> | 2020-06-28 21:25:09 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-28 21:25:09 +0800 |
commit | b3c0c076e5a1b1e7d76fa8d32af0bcbb2c1cd4cf (patch) | |
tree | df90c6ae501508931fbd46ebc6340c90391e1ed5 /include/cru/ui/render/StackLayoutRenderObject.hpp | |
parent | 698242c10cbef4ceaade848fa6aedac71baaf1f2 (diff) | |
download | cru-b3c0c076e5a1b1e7d76fa8d32af0bcbb2c1cd4cf.tar.gz cru-b3c0c076e5a1b1e7d76fa8d32af0bcbb2c1cd4cf.tar.bz2 cru-b3c0c076e5a1b1e7d76fa8d32af0bcbb2c1cd4cf.zip |
...
Diffstat (limited to 'include/cru/ui/render/StackLayoutRenderObject.hpp')
-rw-r--r-- | include/cru/ui/render/StackLayoutRenderObject.hpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/cru/ui/render/StackLayoutRenderObject.hpp b/include/cru/ui/render/StackLayoutRenderObject.hpp index e89e5346..f6b4ffb7 100644 --- a/include/cru/ui/render/StackLayoutRenderObject.hpp +++ b/include/cru/ui/render/StackLayoutRenderObject.hpp @@ -3,7 +3,24 @@ namespace cru::ui::render { // Measure Logic: -// +// Following rules are applied both horizontally and vertically. +// +// 1. Measure each children with min size not specified and max size as +// following rules: +// +// 1.1. If parent's preferred size is set and it is not less than child's min +// size, then it is used as child's max size. +// +// 1.2. Or if parent's max size is set, then it is used as child's max size. +// If it is less than child's min size, then log an warning about that. +// +// 2. Result size is children's max size. +// +// 3. If preferred size is specified and result size is smaller than it, coerce +// result size to preferred size. +// +// 4. If result size is smaller than min size (if specified), coerce result size +// to min size. class StackLayoutRenderObject : public LayoutRenderObject<StackChildLayoutData> { public: |