本文整理汇总了C++中RenderObject::getAbsoluteRepaintRectWithOutline方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderObject::getAbsoluteRepaintRectWithOutline方法的具体用法?C++ RenderObject::getAbsoluteRepaintRectWithOutline怎么用?C++ RenderObject::getAbsoluteRepaintRectWithOutline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderObject
的用法示例。
在下文中一共展示了RenderObject::getAbsoluteRepaintRectWithOutline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAbsoluteRepaintRect
QRect RenderFlow::getAbsoluteRepaintRect()
{
if (isInlineFlow()) {
// Find our leftmost position.
int left = 0;
int top = firstLineBox() ? firstLineBox()->yPos() : 0;
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
if (curr == firstLineBox() || curr->xPos() < left)
left = curr->xPos();
// Now invalidate a rectangle.
int ow = style() ? style()->outlineSize() : 0;
if (isCompact())
left -= m_x;
// We need to add in the relative position offsets of any inlines (including us) up to our
// containing block.
RenderBlock* cb = containingBlock();
for (RenderObject* inlineFlow = this; inlineFlow && inlineFlow->isInlineFlow() && inlineFlow != cb;
inlineFlow = inlineFlow->parent()) {
if (inlineFlow->style()->position() == RELATIVE && inlineFlow->layer())
inlineFlow->layer()->relativePositionOffset(left, top);
}
QRect r(-ow+left, -ow+top, width()+ow*2, height()+ow*2);
if (cb->hasOverflowClip()) {
// cb->height() is inaccurate if we're in the middle of a layout of |cb|, so use the
// layer's size instead. Even if the layer's size is wrong, the layer itself will repaint
// anyway if its size does change.
int x = r.left();
int y = r.top();
QRect boxRect(0, 0, cb->layer()->width(), cb->layer()->height());
cb->layer()->subtractScrollOffset(x,y); // For overflow:auto/scroll/hidden.
QRect repaintRect(x, y, r.width(), r.height());
r = repaintRect.intersect(boxRect);
}
cb->computeAbsoluteRepaintRect(r);
if (ow) {
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (!curr->isText()) {
QRect childRect = curr->getAbsoluteRepaintRectWithOutline(ow);
r = r.unite(childRect);
}
}
if (continuation() && !continuation()->isInline()) {
QRect contRect = continuation()->getAbsoluteRepaintRectWithOutline(ow);
r = r.unite(contRect);
}
}
return r;
}
else {
if (firstLineBox() && firstLineBox()->topOverflow() < 0) {
int ow = style() ? style()->outlineSize() : 0;
QRect r(-ow, -ow+firstLineBox()->topOverflow(),
overflowWidth(false)+ow*2,
overflowHeight(false)+ow*2-firstLineBox()->topOverflow());
computeAbsoluteRepaintRect(r);
return r;
}
}
return RenderContainer::getAbsoluteRepaintRect();
}