提交 ca5fbe31 编写于 作者: O openharmony_ci 提交者: Gitee

!521 修复scrollview页面概率性回弹错误问题

Merge pull request !521 from JayLeeHW/master_log_e
......@@ -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.
先完成此消息的编辑!
想要评论请 注册