本文整理汇总了C++中LayoutRect::transposedRect方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::transposedRect方法的具体用法?C++ LayoutRect::transposedRect怎么用?C++ LayoutRect::transposedRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::transposedRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: computedShapePhysicalBoundingBox
LayoutRect ShapeOutsideInfo::computedShapePhysicalBoundingBox() const
{
LayoutRect physicalBoundingBox = computedShape().shapeMarginLogicalBoundingBox();
physicalBoundingBox.setX(physicalBoundingBox.x() + logicalLeftOffset());
physicalBoundingBox.setY(physicalBoundingBox.y() + logicalTopOffset());
if (m_renderer.style().isFlippedBlocksWritingMode())
physicalBoundingBox.setY(m_renderer.logicalHeight() - physicalBoundingBox.maxY());
if (!m_renderer.style().isHorizontalWritingMode())
physicalBoundingBox = physicalBoundingBox.transposedRect();
return physicalBoundingBox;
}
示例4: collectSelectionRects
void RenderLineBreak::collectSelectionRects(Vector<SelectionRect>& rects, unsigned, unsigned)
{
ensureLineBoxes(*this);
InlineElementBox* box = m_inlineBoxWrapper;
if (!box)
return;
const RootInlineBox& rootBox = box->root();
LayoutRect rect = rootBox.computeCaretRect(box->logicalLeft(), 0, nullptr);
if (rootBox.isFirstAfterPageBreak()) {
if (box->isHorizontal())
rect.shiftYEdgeTo(rootBox.lineTopWithLeading());
else
rect.shiftXEdgeTo(rootBox.lineTopWithLeading());
}
RenderBlock* containingBlock = this->containingBlock();
// Map rect, extended left to leftOffset, and right to rightOffset, through transforms to get minX and maxX.
LogicalSelectionOffsetCaches cache(*containingBlock);
LayoutUnit leftOffset = containingBlock->logicalLeftSelectionOffset(*containingBlock, box->logicalTop(), cache);
LayoutUnit rightOffset = containingBlock->logicalRightSelectionOffset(*containingBlock, box->logicalTop(), cache);
LayoutRect extentsRect = rect;
if (box->isHorizontal()) {
extentsRect.setX(leftOffset);
extentsRect.setWidth(rightOffset - leftOffset);
} else {
extentsRect.setY(leftOffset);
extentsRect.setHeight(rightOffset - leftOffset);
}
extentsRect = localToAbsoluteQuad(FloatRect(extentsRect)).enclosingBoundingBox();
if (!box->isHorizontal())
extentsRect = extentsRect.transposedRect();
bool isFirstOnLine = !box->previousOnLineExists();
bool isLastOnLine = !box->nextOnLineExists();
if (containingBlock->isRubyBase() || containingBlock->isRubyText())
isLastOnLine = !containingBlock->containingBlock()->inlineBoxWrapper()->nextOnLineExists();
bool isFixed = false;
IntRect absRect = localToAbsoluteQuad(FloatRect(rect), UseTransforms, &isFixed).enclosingBoundingBox();
bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().svgStyle().isVerticalWritingMode();
// If the containing block is an inline element, we want to check the inlineBoxWrapper orientation
// to determine the orientation of the block. In this case we also use the inlineBoxWrapper to
// determine if the element is the last on the line.
if (containingBlock->inlineBoxWrapper()) {
if (containingBlock->inlineBoxWrapper()->isHorizontal() != boxIsHorizontal) {
boxIsHorizontal = containingBlock->inlineBoxWrapper()->isHorizontal();
isLastOnLine = !containingBlock->inlineBoxWrapper()->nextOnLineExists();
}
}
rects.append(SelectionRect(absRect, box->direction(), extentsRect.x(), extentsRect.maxX(), extentsRect.maxY(), 0, box->isLineBreak(), isFirstOnLine, isLastOnLine, false, false, boxIsHorizontal, isFixed, containingBlock->isRubyText(), view().pageNumberForBlockProgressionOffset(absRect.x())));
}