本文整理汇总了C++中LayoutRect::setLocation方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::setLocation方法的具体用法?C++ LayoutRect::setLocation怎么用?C++ LayoutRect::setLocation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::setLocation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logicalRectToPhysicalRect
LayoutRect InlineBox::logicalRectToPhysicalRect(const LayoutRect& current)
{
LayoutRect retval = current;
if (!isHorizontal()) {
retval = retval.transposedRect();
}
retval.setLocation(logicalPositionToPhysicalPoint(FloatPoint(retval.location()), FloatSize(retval.size())).toLayoutPoint());
return retval;
}
示例2: logicalRectToPhysicalRect
void InlineBox::logicalRectToPhysicalRect(LayoutRect& current) const
{
if (isHorizontal() && !lineLayoutItem().hasFlippedBlocksWritingMode())
return;
if (!isHorizontal()) {
current = current.transposedRect();
}
current.setLocation(logicalPositionToPhysicalPoint(current.location(), current.size()));
return;
}
示例3: updateWidgetGeometry
bool RenderWidget::updateWidgetGeometry()
{
LayoutRect contentBox = contentBoxRect();
LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
if (m_widget->isFrameView()) {
contentBox.setLocation(absoluteContentBox.location());
return setWidgetGeometry(contentBox);
}
return setWidgetGeometry(absoluteContentBox);
}
示例4: updateWidgetGeometry
bool LayoutPart::updateWidgetGeometry()
{
Widget* widget = this->widget();
ASSERT(widget);
LayoutRect contentBox = contentBoxRect();
LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
if (widget->isFrameView()) {
contentBox.setLocation(absoluteContentBox.location());
return setWidgetGeometry(contentBox);
}
return setWidgetGeometry(absoluteContentBox);
}
示例5: updateWidgetGeometryInternal
bool LayoutPart::updateWidgetGeometryInternal()
{
Widget* widget = this->widget();
ASSERT(widget);
LayoutRect contentBox = contentBoxRect();
LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(FloatRect(contentBox))).boundingBox());
if (widget->isFrameView()) {
if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
contentBox.setLocation(absoluteContentBox.location());
return setWidgetGeometry(contentBox);
}
// TODO(chrishtr): why are these widgets using an absolute rect for their frameRect?
return setWidgetGeometry(absoluteContentBox);
}
示例6: computeOverflowFromFlowThread
void RenderRegion::computeOverflowFromFlowThread()
{
ASSERT(isValid());
LayoutRect layoutRect;
{
// When getting the overflow from the flow thread we need to temporarly reset the current flow thread because
// we're changing flows.
CurrentRenderFlowThreadMaintainer flowThreadMaintainer(m_flowThread);
layoutRect = layoutOverflowRectForBox(m_flowThread);
}
layoutRect.setLocation(contentBoxRect().location() + (layoutRect.location() - m_flowThreadPortionRect.location()));
// FIXME: Correctly adjust the layout overflow for writing modes.
addLayoutOverflow(layoutRect);
RenderFlowThread* enclosingRenderFlowThread = flowThreadContainingBlock();
if (enclosingRenderFlowThread)
enclosingRenderFlowThread->addRegionsLayoutOverflow(this, layoutRect);
updateLayerTransform();
updateScrollInfoAfterLayout();
}
示例7: calculate
void BackgroundImageGeometry::calculate(
const LayoutBoxModelObject& obj,
const LayoutBoxModelObject* paintContainer,
const GlobalPaintFlags globalPaintFlags,
const FillLayer& fillLayer,
const LayoutRect& paintRect) {
LayoutUnit left;
LayoutUnit top;
LayoutSize positioningAreaSize;
bool isLayoutView = obj.isLayoutView();
const LayoutBox* rootBox = nullptr;
if (isLayoutView) {
// It is only possible reach here when root element has a box.
Element* documentElement = obj.document().documentElement();
DCHECK(documentElement);
DCHECK(documentElement->layoutObject());
DCHECK(documentElement->layoutObject()->isBox());
rootBox = toLayoutBox(documentElement->layoutObject());
}
const LayoutBoxModelObject& positioningBox =
isLayoutView ? static_cast<const LayoutBoxModelObject&>(*rootBox) : obj;
// Determine the background positioning area and set destRect to the
// background painting area. destRect will be adjusted later if the
// background is non-repeating.
// FIXME: transforms spec says that fixed backgrounds behave like scroll
// inside transforms.
bool fixedAttachment = fillLayer.attachment() == FixedBackgroundAttachment;
if (RuntimeEnabledFeatures::fastMobileScrollingEnabled()) {
// As a side effect of an optimization to blit on scroll, we do not honor
// the CSS property "background-attachment: fixed" because it may result in
// rendering artifacts. Note, these artifacts only appear if we are blitting
// on scroll of a page that has fixed background images.
fixedAttachment = false;
}
if (!fixedAttachment) {
setDestRect(paintRect);
LayoutUnit right;
LayoutUnit bottom;
// Scroll and Local.
if (fillLayer.origin() != BorderFillBox) {
left = LayoutUnit(positioningBox.borderLeft());
right = LayoutUnit(positioningBox.borderRight());
top = LayoutUnit(positioningBox.borderTop());
bottom = LayoutUnit(positioningBox.borderBottom());
if (fillLayer.origin() == ContentFillBox) {
left += positioningBox.paddingLeft();
right += positioningBox.paddingRight();
top += positioningBox.paddingTop();
bottom += positioningBox.paddingBottom();
}
}
if (isLayoutView) {
// The background of the box generated by the root element covers the
// entire canvas and will be painted by the view object, but the we should
// still use the root element box for positioning.
positioningAreaSize =
rootBox->size() - LayoutSize(left + right, top + bottom),
rootBox->location();
// The input paint rect is specified in root element local coordinate
// (i.e. a transform is applied on the context for painting), and is
// expanded to cover the whole canvas. Since left/top is relative to the
// paint rect, we need to offset them back.
left -= paintRect.x();
top -= paintRect.y();
} else {
positioningAreaSize =
paintRect.size() - LayoutSize(left + right, top + bottom);
}
} else {
setHasNonLocalGeometry();
LayoutRect viewportRect = obj.viewRect();
if (fixedBackgroundPaintsInLocalCoordinates(obj, globalPaintFlags)) {
viewportRect.setLocation(LayoutPoint());
} else {
if (FrameView* frameView = obj.view()->frameView())
viewportRect.setLocation(IntPoint(frameView->scrollOffsetInt()));
// Compensate the translations created by ScrollRecorders.
// TODO(trchen): Fix this for SP phase 2. crbug.com/529963.
viewportRect.moveBy(
accumulatedScrollOffsetForFixedBackground(obj, paintContainer));
}
if (paintContainer)
viewportRect.moveBy(
LayoutPoint(-paintContainer->localToAbsolute(FloatPoint())));
setDestRect(viewportRect);
positioningAreaSize = destRect().size();
}
LayoutSize fillTileSize(
calculateFillTileSize(positioningBox, fillLayer, positioningAreaSize));
// It's necessary to apply the heuristic here prior to any further
// calculations to avoid incorrectly using sub-pixel values that won't be
//.........这里部分代码省略.........