本文整理汇总了C++中RenderObject::addFocusRingRects方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderObject::addFocusRingRects方法的具体用法?C++ RenderObject::addFocusRingRects怎么用?C++ RenderObject::addFocusRingRects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderObject
的用法示例。
在下文中一共展示了RenderObject::addFocusRingRects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addFocusRingRects
void RenderFlow::addFocusRingRects(QPainter *p, int _tx, int _ty)
{
// Only paint focus ring around outermost contenteditable element.
// But skip the body element if it is outermost.
if (element() && element()->isContentEditable()) {
if (element()->parentNode() && !element()->parentNode()->isContentEditable() && element()->id() != ID_BODY)
p->addFocusRingRect(_tx, _ty, width(), height());
return;
}
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
p->addFocusRingRect(_tx + curr->xPos(),
_ty + curr->yPos(),
curr->width(),
curr->height());
}
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (!curr->isText())
curr->addFocusRingRects(p, _tx + curr->xPos(), _ty + curr->yPos());
}
if (continuation())
continuation()->addFocusRingRects(p,
_tx - containingBlock()->xPos() + continuation()->xPos(),
_ty - containingBlock()->yPos() + continuation()->yPos());
}
示例2: addChildFocusRingRects
void RenderLayerModelObject::addChildFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset) const
{
for (RenderObject* current = slowFirstChild(); current; current = current->nextSibling()) {
if (current->isText() || current->isListMarker())
continue;
if (!current->isBox()) {
current->addFocusRingRects(rects, additionalOffset);
continue;
}
RenderBox* box = toRenderBox(current);
if (!box->hasLayer()) {
box->addFocusRingRects(rects, additionalOffset + box->locationOffset());
continue;
}
Vector<LayoutRect> layerFocusRingRects;
box->addFocusRingRects(layerFocusRingRects, LayoutPoint());
for (size_t i = 0; i < layerFocusRingRects.size(); ++i) {
FloatQuad quadInBox = box->localToContainerQuad(FloatQuad(layerFocusRingRects[i]), this);
LayoutRect rect = LayoutRect(quadInBox.boundingBox());
if (!rect.isEmpty()) {
rect.moveBy(additionalOffset);
rects.append(rect);
}
}
}
}
示例3: addFocusRingRects
void RenderInline::addFocusRingRects(QPainter *p, int _tx, int _ty)
{
for (InlineRunBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
p->addFocusRingRect(_tx + curr->xPos(),
_ty + curr->yPos(),
curr->width(),
curr->height());
}
for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
if (!curr->isText())
curr->addFocusRingRects(p, _tx + curr->xPos(), _ty + curr->yPos());
}
if (continuation())
continuation()->addFocusRingRects(p,
_tx - containingBlock()->xPos() + continuation()->xPos(),
_ty - containingBlock()->yPos() + continuation()->yPos());
}