本文整理汇总了C++中RenderObject::absoluteToLocal方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderObject::absoluteToLocal方法的具体用法?C++ RenderObject::absoluteToLocal怎么用?C++ RenderObject::absoluteToLocal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderObject
的用法示例。
在下文中一共展示了RenderObject::absoluteToLocal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertToRenderer
IntRect FrameView::convertToRenderer(const RenderObject& renderer, const IntRect& viewRect) const
{
IntRect rect = viewRect;
// FIXME: we don't have a way to map an absolute rect down to a local quad, so just
// move the rect for now.
rect.setLocation(roundedIntPoint(renderer.absoluteToLocal(rect.location(), UseTransforms)));
return rect;
}
示例2: calculateClipRect
IntRect PluginView::calculateClipRect() const
{
FrameView* frameView = toFrameView(parent());
bool visible = frameView && isVisible();
RenderObject* renderer = m_element->renderer();
if (visible && frameView->width() && frameView->height() && renderer) {
IntSize windowSize = frameView->hostWindow()->platformPageClient()->viewportSize();
// Get the clipped rectangle for this player within the current frame.
IntRect visibleContentRect;
IntRect contentRect = renderer->absoluteClippedOverflowRect();
FloatPoint contentLocal = renderer->absoluteToLocal(FloatPoint(contentRect.location()));
contentRect.setLocation(roundedIntPoint(contentLocal));
contentRect.move(frameRect().x(), frameRect().y());
// Clip against any frames that the widget is inside. Note that if the frames are also clipped
// by a div, that will not be included in this calculation. That is an improvement that still
// needs to be made.
const Widget* current = this;
while (current->parent() && visible) {
// Determine if it is visible in this scrollview.
visibleContentRect = current->parent()->visibleContentRect();
// Special case for the root ScrollView. Its size does not match the actual window size.
if (current->parent() == root())
visibleContentRect.setSize(windowSize);
contentRect.intersect(visibleContentRect);
visible = !contentRect.isEmpty();
// Offset to visible coordinates in scrollview widget's coordinate system (except in the case of
// the top scroll view).
if (current->parent()->parent())
contentRect.move(-visibleContentRect.x(), -visibleContentRect.y());
current = current->parent();
// Don't include the offset for the root window or we get the wrong coordinates.
if (current->parent()) {
// Move content rect into the parent scrollview's coordinates.
IntRect curFrameRect = current->frameRect();
contentRect.move(curFrameRect.x(), curFrameRect.y());
}
}
return contentRect;
}
return IntRect();
}