From 7fd9ca808c908c67d9bec2183034ad16ea86a912 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 2 Apr 2020 21:09:06 +0800 Subject: ... --- include/cru/ui/render/layout_render_object.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/cru/ui/render/layout_render_object.hpp') diff --git a/include/cru/ui/render/layout_render_object.hpp b/include/cru/ui/render/layout_render_object.hpp index 8700b8ba..5c4c9c5c 100644 --- a/include/cru/ui/render/layout_render_object.hpp +++ b/include/cru/ui/render/layout_render_object.hpp @@ -18,9 +18,9 @@ class LayoutRenderObject : public RenderObject { ~LayoutRenderObject() override = default; - ChildLayoutData* GetChildLayoutData(int position) { + ChildLayoutData* GetChildLayoutData(Index position) { Expects(position >= 0 && - position < static_cast(child_layout_data_.size())); + position < static_cast(child_layout_data_.size())); return &child_layout_data_[position]; } @@ -29,8 +29,8 @@ class LayoutRenderObject : public RenderObject { RenderObject* HitTest(const Point& point) override; protected: - void OnAddChild(RenderObject* new_child, int position) override; - void OnRemoveChild(RenderObject* removed_child, int position) override; + void OnAddChild(RenderObject* new_child, Index position) override; + void OnRemoveChild(RenderObject* removed_child, Index position) override; private: std::vector child_layout_data_{}; @@ -72,7 +72,7 @@ RenderObject* LayoutRenderObject::HitTest( template void LayoutRenderObject::OnAddChild(RenderObject* new_child, - int position) { + const Index position) { CRU_UNUSED(new_child) child_layout_data_.emplace(child_layout_data_.cbegin() + position); @@ -80,7 +80,7 @@ void LayoutRenderObject::OnAddChild(RenderObject* new_child, template void LayoutRenderObject::OnRemoveChild( - RenderObject* removed_child, int position) { + RenderObject* removed_child, const Index position) { CRU_UNUSED(removed_child) child_layout_data_.erase(child_layout_data_.cbegin() + position); -- cgit v1.2.3