From 7fd9ca808c908c67d9bec2183034ad16ea86a912 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 2 Apr 2020 21:09:06 +0800 Subject: ... --- src/ui/render/render_object.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ui/render/render_object.cpp') diff --git a/src/ui/render/render_object.cpp b/src/ui/render/render_object.cpp index c1b1b19b..e329d150 100644 --- a/src/ui/render/render_object.cpp +++ b/src/ui/render/render_object.cpp @@ -5,7 +5,7 @@ #include namespace cru::ui::render { -void RenderObject::AddChild(RenderObject* render_object, const int position) { +void RenderObject::AddChild(RenderObject* render_object, const Index position) { Expects(child_mode_ != ChildMode::None); Expects(!(child_mode_ == ChildMode::Single && children_.size() > 0)); @@ -14,7 +14,7 @@ void RenderObject::AddChild(RenderObject* render_object, const int position) { Expects(position >= 0); // Position index is less than 0. Expects( position <= - static_cast(children_.size())); // Position index is out of bound. + static_cast(children_.size())); // Position index is out of bound. children_.insert(children_.cbegin() + position, render_object); render_object->SetParent(this); @@ -22,9 +22,9 @@ void RenderObject::AddChild(RenderObject* render_object, const int position) { OnAddChild(render_object, position); } -void RenderObject::RemoveChild(const int position) { +void RenderObject::RemoveChild(const Index position) { Expects(position >= 0); // Position index is less than 0. - Expects(position < static_cast( + Expects(position < static_cast( children_.size())); // Position index is out of bound. const auto i = children_.cbegin() + position; @@ -72,7 +72,7 @@ void RenderObject::OnParentChanged(RenderObject* old_parent, CRU_UNUSED(new_parent) } -void RenderObject::OnAddChild(RenderObject* new_child, int position) { +void RenderObject::OnAddChild(RenderObject* new_child, Index position) { CRU_UNUSED(new_child) CRU_UNUSED(position) @@ -80,7 +80,7 @@ void RenderObject::OnAddChild(RenderObject* new_child, int position) { InvalidatePaint(); } -void RenderObject::OnRemoveChild(RenderObject* removed_child, int position) { +void RenderObject::OnRemoveChild(RenderObject* removed_child, Index position) { CRU_UNUSED(removed_child) CRU_UNUSED(position) -- cgit v1.2.3