mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-29 09:39:12 -04:00
Return Widget::children() by reference.
This commit is contained in:
parent
2b6bc03408
commit
5a66c68861
2 changed files with 9 additions and 5 deletions
|
@ -46,6 +46,8 @@ bool is_dirty() {
|
|||
|
||||
/* Widget ****************************************************************/
|
||||
|
||||
const std::vector<Widget*> Widget::no_children { };
|
||||
|
||||
Point Widget::screen_pos() {
|
||||
return screen_rect().pos;
|
||||
}
|
||||
|
@ -153,8 +155,8 @@ bool Widget::on_touch(const TouchEvent event) {
|
|||
return false;
|
||||
}
|
||||
|
||||
const std::vector<Widget*> Widget::children() const {
|
||||
return { };
|
||||
const std::vector<Widget*>& Widget::children() const {
|
||||
return no_children;
|
||||
}
|
||||
|
||||
Context& Widget::context() const {
|
||||
|
@ -244,7 +246,7 @@ void View::remove_child(Widget* const widget) {
|
|||
}
|
||||
}
|
||||
|
||||
const std::vector<Widget*> View::children() const {
|
||||
const std::vector<Widget*>& View::children() const {
|
||||
return children_;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue