aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/render/LayoutRenderObject.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-21 21:43:42 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-21 22:13:54 +0800
commitfd61739197ec009d47da87a7cc66970a55f12db4 (patch)
treebb2bc007aaf9b47fecb090df96c23b5ee6a898e3 /include/cru/ui/render/LayoutRenderObject.h
parent3b875091c445b7465b9bd044914318989a94d2ad (diff)
downloadcru-fd61739197ec009d47da87a7cc66970a55f12db4.tar.gz
cru-fd61739197ec009d47da87a7cc66970a55f12db4.tar.bz2
cru-fd61739197ec009d47da87a7cc66970a55f12db4.zip
Clean codes. Remove member function const in RenderObject.
Diffstat (limited to 'include/cru/ui/render/LayoutRenderObject.h')
-rw-r--r--include/cru/ui/render/LayoutRenderObject.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/include/cru/ui/render/LayoutRenderObject.h b/include/cru/ui/render/LayoutRenderObject.h
index 9970c16c..4010ae7c 100644
--- a/include/cru/ui/render/LayoutRenderObject.h
+++ b/include/cru/ui/render/LayoutRenderObject.h
@@ -20,15 +20,10 @@ class LayoutRenderObject : public RenderObject {
};
protected:
- LayoutRenderObject() = default;
+ LayoutRenderObject(std::string name) : RenderObject(std::move(name)) {}
public:
- CRU_DELETE_COPY(LayoutRenderObject)
- CRU_DELETE_MOVE(LayoutRenderObject)
-
- ~LayoutRenderObject() override = default;
-
- Index GetChildCount() const { return static_cast<Index>(children_.size()); }
+ Index GetChildCount() { return static_cast<Index>(children_.size()); }
RenderObject* GetChildAt(Index position) {
Expects(position >= 0 && position < GetChildCount());
@@ -75,7 +70,7 @@ class LayoutRenderObject : public RenderObject {
InvalidateLayout();
}
- const ChildLayoutData& GetChildLayoutDataAt(Index position) const {
+ const ChildLayoutData& GetChildLayoutDataAt(Index position) {
Expects(position >= 0 && position < GetChildCount());
return children_[position].layout_data;
}