提交 f5e47c1a 编写于 作者: L liqiang

fix get all children relative rect calculate error bug

Signed-off-by: Nliqiang <liqiang121@huawei.com>
Change-Id: I67ffbd60a015bd8efe2c6739659eb703f5afc1b6
上级 a3900cae
......@@ -237,15 +237,21 @@ void UIViewGroup::GetTargetView(const Point& point, UIView** current, UIView** t
Rect UIViewGroup::GetAllChildRelativeRect() const
{
Rect rect;
Rect rect = {0, 0, 0, 0};
UIView* view = childrenHead_;
if (view != nullptr) {
rect = view->GetRelativeRect();
view = view->GetNextSibling();
}
bool isRectValid = false;
while (view != nullptr) {
if (!view->IsVisible()) {
view = view->GetNextSibling();
continue;
}
Rect rectChild = view->GetRelativeRect();
rect.Join(rect, rectChild);
if (!isRectValid) {
rect = rectChild;
isRectValid = true;
} else {
rect.Join(rect, rectChild);
}
view = view->GetNextSibling();
}
return rect;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册