本文整理汇总了C++中InlineTextBox::selectionRect方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineTextBox::selectionRect方法的具体用法?C++ InlineTextBox::selectionRect怎么用?C++ InlineTextBox::selectionRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineTextBox
的用法示例。
在下文中一共展示了InlineTextBox::selectionRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeAbsoluteRectForRange
IntRect RenderSVGInlineText::computeAbsoluteRectForRange(int startPos, int endPos)
{
IntRect rect;
RenderBlock* cb = containingBlock();
if (!cb || !cb->container())
return rect;
RenderSVGRoot* root = findSVGRootObject(parent());
if (!root)
return rect;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
rect.unite(box->selectionRect(0, 0, startPos, endPos));
// Mimic RenderBox::computeAbsoluteRepaintRect() functionality. But only the subset needed for SVG and respecting SVG transformations.
int x, y;
cb->container()->absolutePosition(x, y);
// Remove HTML parent translation offsets here! These need to be retrieved from the RenderSVGRoot object.
// But do take the containingBlocks's container position into account, ie. SVG text in scrollable <div>.
AffineTransform htmlParentCtm = root->RenderContainer::absoluteTransform();
FloatRect fixedRect(narrowPrecisionToFloat(rect.x() + x - xPos() - htmlParentCtm.e()), narrowPrecisionToFloat(rect.y() + y - yPos() - htmlParentCtm.f()), rect.width(), rect.height());
return enclosingIntRect(absoluteTransform().mapRect(fixedRect));
}
示例2: computeRepaintQuadForRange
FloatQuad RenderSVGInlineText::computeRepaintQuadForRange(RenderBoxModelObject* repaintContainer, int startPos, int endPos)
{
RenderBlock* cb = containingBlock();
if (!cb || !cb->container())
return FloatQuad();
RenderSVGRoot* root = findSVGRootObject(parent());
if (!root)
return FloatQuad();
IntRect rect;
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
rect.unite(box->selectionRect(0, 0, startPos, endPos));
return localToContainerQuad(FloatQuad(rect), repaintContainer);
}