您的位置:首页 > 编程语言

ScrollView裁剪bug?需要修改的函数代码处

2017-04-15 22:49 218 查看
bool Widget::isClippingParentContainsPoint(const Vec2 &pt)
{
_affectByClipping = false;

// FIXME
#if 0
Widget* parent = getWidgetParent();
Widget* clippingParent = nullptr;
while (parent)
{
Layout* layoutParent = dynamic_cast<Layout*>(parent);
if (layoutParent)
{
if (layoutParent->isClippingEnabled())
{
_affectByClipping = true;
clippingParent = layoutParent;
break;
}
}
parent = parent->getWidgetParent();
}
}
#else
Node* parent = getParent();
Widget* clippingParent = nullptr;
while (parent)
{
Layout* layoutParent = dynamic_cast<Layout*>(parent);
if (layoutParent)
{
if (layoutParent->isClippingEnabled())
{
_affectByClipping = true;
clippingParent = layoutParent;
break;
}
}
parent = parent->getParent();
}
#endif

if (!_affectByClipping)
{
return true;
}

if (clippingParent)
{
bool bRet = false;
if (clippingParent->hitTest(pt, _hittedByCamera, nullptr))
{
bRet = true;
}
if (bRet)
{
return clippingParent->isClippingParentContainsPoint(pt);
}
return false;
}
return true;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐