From 221c62de313ad811ca2b3ae8ba43996c96c347bc Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 13 Dec 2019 23:53:06 +0800 Subject: ... --- src/ui/render/render_object.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 b6a9e8e4..7f6255f7 100644 --- a/src/ui/render/render_object.cpp +++ b/src/ui/render/render_object.cpp @@ -11,9 +11,10 @@ void RenderObject::AddChild(RenderObject* render_object, const int position) { assert(!(child_mode_ == ChildMode::Single && children_.size() > 0)); assert(render_object->GetParent() == - nullptr); // Render object already has a parent. - assert(position >= 0); // Position index is less than 0. - assert(position <= children_.size()); // Position index is out of bound. + nullptr); // Render object already has a parent. + assert(position >= 0); // Position index is less than 0. + assert(position <= static_cast( + children_.size())); // Position index is out of bound. children_.insert(children_.cbegin() + position, render_object); render_object->SetParent(this); @@ -21,8 +22,9 @@ void RenderObject::AddChild(RenderObject* render_object, const int position) { } void RenderObject::RemoveChild(const int position) { - assert(position >= 0); // Position index is less than 0. - assert(position < children_.size()); // Position index is out of bound. + assert(position >= 0); // Position index is less than 0. + assert(position < static_cast( + children_.size())); // Position index is out of bound. const auto i = children_.cbegin() + position; const auto removed_child = *i; -- cgit v1.2.3