diff options
author | crupest <crupest@outlook.com> | 2019-04-04 17:12:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-04 17:12:25 +0800 |
commit | a410e2048db6f5ef6fb50e401a59b4b98b979050 (patch) | |
tree | 500680c63b074e8c3eefd756fd6a1d0f41840c1a /src/ui/layout_control.cpp | |
parent | fcaf471275a67d718887430ee63a53890915c4c7 (diff) | |
download | cru-a410e2048db6f5ef6fb50e401a59b4b98b979050.tar.gz cru-a410e2048db6f5ef6fb50e401a59b4b98b979050.tar.bz2 cru-a410e2048db6f5ef6fb50e401a59b4b98b979050.zip |
...
Diffstat (limited to 'src/ui/layout_control.cpp')
-rw-r--r-- | src/ui/layout_control.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/layout_control.cpp b/src/ui/layout_control.cpp index c0c4a7fe..9d789670 100644 --- a/src/ui/layout_control.cpp +++ b/src/ui/layout_control.cpp @@ -1,7 +1,9 @@ -#include "layout_control.hpp" +#include "cru/ui/layout_control.hpp" #include "window.hpp" +#include <cassert> + namespace cru::ui { LayoutControl::~LayoutControl() { for (const auto child : children_) delete child; @@ -10,7 +12,8 @@ LayoutControl::~LayoutControl() { void LayoutControl::AddChild(Control* control, const int position) { assert(control->GetParent() == nullptr); // The control already has a parent. assert(!dynamic_cast<Window*>(control)); // Can't add a window as child. - assert(position >= 0 || position <= this->children_.size()); // The position is out of range. + assert(position >= 0 || + position <= this->children_.size()); // The position is out of range. children_.insert(this->children_.cbegin() + position, control); |