本文整理汇总了C++中webcore::IntRect::right方法的典型用法代码示例。如果您正苦于以下问题:C++ IntRect::right方法的具体用法?C++ IntRect::right怎么用?C++ IntRect::right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::IntRect
的用法示例。
在下文中一共展示了IntRect::right方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pinMaxMin
void CachedHistory::pinMaxMin(const WebCore::IntRect& viewBounds)
{
if (mMinWorkingHorizontal < viewBounds.y() ||
mMinWorkingHorizontal >= viewBounds.bottom())
mMinWorkingHorizontal = viewBounds.y();
if (mMaxWorkingHorizontal > viewBounds.bottom() ||
mMaxWorkingHorizontal <= viewBounds.y())
mMaxWorkingHorizontal = viewBounds.bottom();
if (mMinWorkingVertical < viewBounds.x() ||
mMinWorkingVertical >= viewBounds.right())
mMinWorkingVertical = viewBounds.x();
if (mMaxWorkingVertical > viewBounds.right() ||
mMaxWorkingVertical <= viewBounds.x())
mMaxWorkingVertical = viewBounds.right();
}
示例2: fixUpFocusRects
void CachedNode::fixUpFocusRects()
{
if (mFixedUpFocusRects)
return;
mFixedUpFocusRects = true;
if (mNavableRects <= 1)
return;
#if DEBUG_NAV_UI
{
WebCore::IntRect* boundsPtr = mFocusRing.begin() - 1;
const WebCore::IntRect* const boundsEnd = mFocusRing.begin() + mFocusRing.size();
while (++boundsPtr < boundsEnd)
LOGD("%s %d:(%d, %d, %d, %d)\n", __FUNCTION__, boundsPtr - mFocusRing.begin(),
boundsPtr->x(), boundsPtr->y(), boundsPtr->width(), boundsPtr->height());
}
#endif
// q: need to know when rects are for drawing and hit-testing, but not mouse down calcs?
bool again;
do {
again = false;
size_t size = mFocusRing.size();
WebCore::IntRect* unitBoundsPtr = mFocusRing.begin() - 1;
const WebCore::IntRect* const unitBoundsEnd = mFocusRing.begin() + size;
while (++unitBoundsPtr < unitBoundsEnd) {
// any other unitBounds to the left or right of this one?
int unitTop = unitBoundsPtr->y();
int unitBottom = unitBoundsPtr->bottom();
int unitLeft = unitBoundsPtr->x();
int unitRight = unitBoundsPtr->right();
WebCore::IntRect* testBoundsPtr = mFocusRing.begin() - 1;
while (++testBoundsPtr < unitBoundsEnd) {
if (unitBoundsPtr == testBoundsPtr)
continue;
int testTop = testBoundsPtr->y();
int testBottom = testBoundsPtr->bottom();
int testLeft = testBoundsPtr->x();
int testRight = testBoundsPtr->right();
int candidateTop = unitTop > testTop ? unitTop : testTop;
int candidateBottom = unitBottom < testBottom ? unitBottom : testBottom;
int candidateLeft = unitRight < testLeft ? unitRight : testRight;
int candidateRight = unitRight > testLeft ? unitLeft : testLeft;
bool leftRight = true;
if (candidateTop + OVERLAP >= candidateBottom ||
candidateLeft + OVERLAP >= candidateRight) {
candidateTop = unitBottom < testTop ? unitBottom : testBottom;
candidateBottom = unitBottom > testTop ? unitTop : testTop;
candidateLeft = unitLeft > testLeft ? unitLeft : testLeft;
candidateRight = unitRight < testRight ? unitRight : testRight;
if (candidateTop + OVERLAP >= candidateBottom ||
candidateLeft + OVERLAP >= candidateRight)
continue;
leftRight = false;
}
// construct candidate to add
WebCore::IntRect candidate = WebCore::IntRect(candidateLeft, candidateTop,
candidateRight - candidateLeft, candidateBottom - candidateTop);
// does a different unit bounds intersect the candidate? if so, don't add
WebCore::IntRect* checkBoundsPtr = mFocusRing.begin() - 1;
while (++checkBoundsPtr < unitBoundsEnd) {
if (checkBoundsPtr->intersects(candidate) == false)
continue;
if (leftRight) {
if (candidateTop >= checkBoundsPtr->y() &&
candidateBottom > checkBoundsPtr->bottom())
candidateTop = checkBoundsPtr->bottom();
else if (candidateTop < checkBoundsPtr->y() &&
candidateBottom <= checkBoundsPtr->bottom())
candidateBottom = checkBoundsPtr->y();
else
goto nextCheck;
} else {
if (candidateLeft >= checkBoundsPtr->x() &&
candidateRight > checkBoundsPtr->right())
candidateLeft = checkBoundsPtr->right();
else if (candidateLeft < checkBoundsPtr->x() &&
candidateRight <= checkBoundsPtr->right())
candidateRight = checkBoundsPtr->x();
else
goto nextCheck;
}
}
candidate = WebCore::IntRect(candidateLeft, candidateTop,
candidateRight - candidateLeft, candidateBottom - candidateTop);
ASSERT(candidate.isEmpty() == false);
#if DEBUG_NAV_UI
LOGD("%s %d:(%d, %d, %d, %d)\n", __FUNCTION__, mFocusRing.size(),
candidate.x(), candidate.y(), candidate.width(), candidate.height());
#endif
mFocusRing.append(candidate);
again = true;
goto tryAgain;
nextCheck:
continue;
}
}
tryAgain:
;
} while (again);
}