diff options
Diffstat (limited to 'include/cru/ui/render')
-rw-r--r-- | include/cru/ui/render/LayoutRenderObject.hpp | 13 |
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; |