From 2ef55b1fdbbe6f13ab835e20021b9ae53322d75e Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 28 Jun 2020 00:17:50 +0800 Subject: ... --- include/cru/ui/render/LayoutRenderObject.hpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/cru/ui/render/LayoutRenderObject.hpp') 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(child_layout_data_.size())); - return &child_layout_data_[position]; + position < static_cast(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(this->child_layout_data_.size())); + return this->child_layout_data_[position]; } void Draw(platform::graph::IPainter* painter) override; -- cgit v1.2.3