From 7ee8ff29bdeb25d599dfc8b876bdcd1fb0fc29fd Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 28 May 2014 21:56:22 +0200 Subject: [PATCH] [DEV] correct assert --- sources/ewol/widget/Layer.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sources/ewol/widget/Layer.cpp b/sources/ewol/widget/Layer.cpp index 6dc12297..eaedf31c 100644 --- a/sources/ewol/widget/Layer.cpp +++ b/sources/ewol/widget/Layer.cpp @@ -34,19 +34,20 @@ ewol::object::Shared ewol::widget::Layer::getWidgetAtPos(const vec return nullptr; } // for all element in the sizer ... - for (auto it : m_subWidget) { - if (it != nullptr) { - vec2 tmpSize = it->getSize(); - vec2 tmpOrigin = it->getOrigin(); - if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) - && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) - { - ewol::object::Shared tmpWidget = it->getWidgetAtPos(_pos); - if (nullptr != tmpWidget) { - return tmpWidget; - } - // parse the next layer ... + for (auto &it : m_subWidget) { + if (it == nullptr) { + continue; + } + vec2 tmpSize = it->getSize(); + vec2 tmpOrigin = it->getOrigin(); + if( (tmpOrigin.x() <= _pos.x() && tmpOrigin.x() + tmpSize.x() >= _pos.x()) + && (tmpOrigin.y() <= _pos.y() && tmpOrigin.y() + tmpSize.y() >= _pos.y()) ) + { + ewol::object::Shared tmpWidget = it->getWidgetAtPos(_pos); + if (nullptr != tmpWidget) { + return tmpWidget; } + // parse the next layer ... } } return nullptr;