本文整理汇总了C++中webcore::IntRect::setY方法的典型用法代码示例。如果您正苦于以下问题:C++ IntRect::setY方法的具体用法?C++ IntRect::setY怎么用?C++ IntRect::setY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::IntRect
的用法示例。
在下文中一共展示了IntRect::setY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindBestNode
void DocumentNavigator::FindBestNode(WebCore::Node* rootNode)
{
// Note by Arpit Baldeva - Changed the recursive algorithm to an iterative algorithm. This results in 25% to 40% increase in efficiency.
while (rootNode)
{
IsNodeNavigableDelegate nodeNavigableDelegate(mView);
// As it turns out, getRect on HTMLElement is pretty expensive. So we don't do it inside the delegate as we require getRect here too. We do that check here.
// It is at least ~15% more efficient and can be up to ~25% more efficient (depends on the page layout and current node you are at).
nodeNavigableDelegate(rootNode,false);
if (nodeNavigableDelegate.FoundNode())
{
WebCore::HTMLElement* htmlElement = (WebCore::HTMLElement*) rootNode;
WebCore::IntRect rectAbsolute = htmlElement->getRect();
// Adjust the rectangle position based on the frame offset so that we have absolute geometrical position.
WebCore::FrameView* pFrameView = htmlElement->document()->view(); //Can be NULL
if(pFrameView)
{
rectAbsolute.setX(rectAbsolute.x() + pFrameView->x());
rectAbsolute.setY(rectAbsolute.y() + pFrameView->y());
}
/* printf("Looking at ELEMENT_NODE : nodeName=%S (%d,%d)->(%d,%d) ThetaRange(%f,%f)\n\n%S\n-----------------------------------\n",
htmlElement->tagName().charactersWithNullTermination(),
rect.topLeft().x(),rect.topLeft().y(),
rect.bottomRight().x(), rect.bottomRight().y(),
mMinThetaRange,mMaxThetaRange,
htmlElement->innerHTML().charactersWithNullTermination()
);
*/
if (!WouldBeTrappedInElement(rectAbsolute,mStartingPosition,mDirection))
{
if (!TryingToDoPerpendicularJump(rectAbsolute,mPreviousNodeRect,mDirection))
{
if(rectAbsolute.width()>=1 && rectAbsolute.height() >= 1) //Avoid 0 size elements
{
if (doAxisCheck(rectAbsolute))
{
PolarRegion pr(rectAbsolute, mStartingPosition);
if (pr.minR < mMinR )
{
if (areAnglesInRange(pr.minTheta,pr.maxTheta))
{
mMinR = pr.minR;
EAW_ASSERT( *(uint32_t*)rootNode > 10000000u );
//mBestNode = rootNode; //We don't assign it here since we do the Z-layer testing later on.
FoundNodeInfo foundNodeInfo = {rootNode, mMinR};
mNodeListContainer->mFoundNodes.push_back(foundNodeInfo);
/*printf("Found ELEMENT_NODE : nodeName=%s (%d,%d)->(%d,%d) polar: R(%f,%f) Theta(%f,%f) ThetaRange(%f,%f) \n",
(char*)htmlElement->nodeName().characters(),
rect.topLeft().x(),rect.topLeft().y(),
rect.bottomRight().x(), rect.bottomRight().y(),
pr.minR,pr.maxR,pr.minTheta,pr.maxTheta,
mMinThetaRange,mMaxThetaRange
);*/
}
else
{
#if EAWEBKIT_ENABLE_JUMP_NAVIGATION_DEBUGGING
mNodeListContainer->mRejectedByAngleNodes.push_back(rootNode);
#endif
/*printf("RejectedA ELEMENT_NODE : nodeName=%s (%d,%d)->(%d,%d) polar: R(%f,%f) Theta(%f,%f) ThetaRange(%f,%f) \n",
(char*)htmlElement->nodeName().characters(),
rect.topLeft().x(),rect.topLeft().y(),
rect.bottomRight().x(), rect.bottomRight().y(),
pr.minR,pr.maxR,pr.minTheta,pr.maxTheta,
mMinThetaRange,mMaxThetaRange
);*/
}
}
else
{
#if EAWEBKIT_ENABLE_JUMP_NAVIGATION_DEBUGGING
mNodeListContainer->mRejectedByRadiusNodes.push_back(rootNode);
#endif
/*printf("RejectedR ELEMENT_NODE : nodeName=%s (%d,%d)->(%d,%d) polar: R(%f,%f) Theta(%f,%f) ThetaRange(%f,%f) \n",
(char*)htmlElement->nodeName().characters(),
rect.topLeft().x(),rect.topLeft().y(),
rect.bottomRight().x(), rect.bottomRight().y(),
pr.minR,pr.maxR,pr.minTheta,pr.maxTheta,
mMinThetaRange,mMaxThetaRange
);*/
}
}
else
{
//printf(" - failed axis check\n");
}
}
else
{
//printf(" - too small\n");
}
//.........这里部分代码省略.........