本文整理汇总了C++中InlineTextBox::frameRect方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineTextBox::frameRect方法的具体用法?C++ InlineTextBox::frameRect怎么用?C++ InlineTextBox::frameRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineTextBox
的用法示例。
在下文中一共展示了InlineTextBox::frameRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: relativeBounds
// Bounds of the LayoutObject relative to the scroller's visible content rect.
static LayoutRect relativeBounds(const LayoutObject* layoutObject,
const ScrollableArea* scroller) {
LayoutRect localBounds;
if (layoutObject->isBox()) {
localBounds = toLayoutBox(layoutObject)->borderBoxRect();
if (!layoutObject->hasOverflowClip()) {
// borderBoxRect doesn't include overflow content and floats.
LayoutUnit maxHeight =
std::max(localBounds.height(),
toLayoutBox(layoutObject)->layoutOverflowRect().height());
if (layoutObject->isLayoutBlockFlow() &&
toLayoutBlockFlow(layoutObject)->containsFloats()) {
// Note that lowestFloatLogicalBottom doesn't include floating
// grandchildren.
maxHeight = std::max(
maxHeight,
toLayoutBlockFlow(layoutObject)->lowestFloatLogicalBottom());
}
localBounds.setHeight(maxHeight);
}
} else if (layoutObject->isText()) {
// TODO(skobes): Use first and last InlineTextBox only?
for (InlineTextBox* box = toLayoutText(layoutObject)->firstTextBox(); box;
box = box->nextTextBox())
localBounds.unite(box->frameRect());
} else {
// Only LayoutBox and LayoutText are supported.
ASSERT_NOT_REACHED();
}
LayoutRect relativeBounds = LayoutRect(
scroller->localToVisibleContentQuad(FloatRect(localBounds), layoutObject)
.boundingBox());
return relativeBounds;
}