aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/LayoutRenderObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/render/LayoutRenderObject.h')
-rw-r--r--include/cru/ui/render/LayoutRenderObject.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/include/cru/ui/render/LayoutRenderObject.h b/include/cru/ui/render/LayoutRenderObject.h
index 62ee9005..d6882f9a 100644
--- a/include/cru/ui/render/LayoutRenderObject.h
+++ b/include/cru/ui/render/LayoutRenderObject.h
@@ -11,7 +11,7 @@ class CRU_UI_API LayoutRenderObject : public RenderObject {
private:
struct ChildData {
- RenderObject* child;
+ RenderObject* render_object;
ChildLayoutData layout_data;
};
@@ -43,19 +43,19 @@ class CRU_UI_API LayoutRenderObject : public RenderObject {
children_.erase(children_.begin() + position);
}
- void SetChildLayoutData(Index position, ChildLayoutData data) {
+ const ChildLayoutData& GetChildLayoutDataAt(Index position) const {
Expects(position >= 0 && position < GetChildCount());
- children_[position].layout_data = std::move(data);
- InvalidateLayout();
+ return children_[position].layout_data;
}
- const ChildLayoutData& GetChildLayoutData(Index position) const {
+ void SetChildLayoutDataAt(Index position, ChildLayoutData data) {
Expects(position >= 0 && position < GetChildCount());
- return children_[position].layout_data;
+ children_[position].layout_data = std::move(data);
+ InvalidateLayout();
}
void Draw(platform::graphics::IPainter* painter) override {
- for (auto& child : children_) {
+ for (const auto& child : children_) {
painter->PushState();
painter->ConcatTransform(
Matrix::Translation(child.render_object->GetOffset()));