aboutsummaryrefslogtreecommitdiff
path: root/src/ui/render/render_object.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-12-13 23:53:06 +0800
committercrupest <crupest@outlook.com>2019-12-13 23:53:06 +0800
commit221c62de313ad811ca2b3ae8ba43996c96c347bc (patch)
tree57419e033536e4a9aec0b3ecd26274120352a6f2 /src/ui/render/render_object.cpp
parentf452d4826ad4023c28d6dd59686b3cf5d6340235 (diff)
downloadcru-221c62de313ad811ca2b3ae8ba43996c96c347bc.tar.gz
cru-221c62de313ad811ca2b3ae8ba43996c96c347bc.tar.bz2
cru-221c62de313ad811ca2b3ae8ba43996c96c347bc.zip
...
Diffstat (limited to 'src/ui/render/render_object.cpp')
-rw-r--r--src/ui/render/render_object.cpp12
1 files changed, 7 insertions, 5 deletions
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<int>(
+ 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<int>(
+ children_.size())); // Position index is out of bound.
const auto i = children_.cbegin() + position;
const auto removed_child = *i;