aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-28 00:17:50 +0800
committercrupest <crupest@outlook.com>2020-06-28 00:17:50 +0800
commit2ef55b1fdbbe6f13ab835e20021b9ae53322d75e (patch)
treefb25d95530c3b3a193a3337a835a206c07f32885 /include/cru/ui/render
parentb5e5dc788b400fc5d9190d2d5e6bc5f0f6755511 (diff)
downloadcru-2ef55b1fdbbe6f13ab835e20021b9ae53322d75e.tar.gz
cru-2ef55b1fdbbe6f13ab835e20021b9ae53322d75e.tar.bz2
cru-2ef55b1fdbbe6f13ab835e20021b9ae53322d75e.zip
...
Diffstat (limited to 'include/cru/ui/render')
-rw-r--r--include/cru/ui/render/LayoutRenderObject.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/cru/ui/render/LayoutRenderObject.hpp b/include/cru/ui/render/LayoutRenderObject.hpp
index f99eb4ca..1eb9a816 100644
--- a/include/cru/ui/render/LayoutRenderObject.hpp
+++ b/include/cru/ui/render/LayoutRenderObject.hpp
@@ -22,10 +22,17 @@ class LayoutRenderObject : public RenderObject {
return this->child_layout_data_;
}
- ChildLayoutData* GetChildLayoutData(Index position) {
+ void SetChildLayoutData(Index position, ChildLayoutData data) {
Expects(position >= 0 &&
- position < static_cast<Index>(child_layout_data_.size()));
- return &child_layout_data_[position];
+ position < static_cast<Index>(this->child_layout_data_.size()));
+ this->child_layout_data_[position] = std::move(data);
+ this->InvalidateLayout();
+ }
+
+ const ChildLayoutData& GetChildLayoutData(Index position) const {
+ Expects(position >= 0 &&
+ position < static_cast<Index>(this->child_layout_data_.size()));
+ return this->child_layout_data_[position];
}
void Draw(platform::graph::IPainter* painter) override;