本文整理汇总了C++中InlineFlowBox::borderLogicalLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineFlowBox::borderLogicalLeft方法的具体用法?C++ InlineFlowBox::borderLogicalLeft怎么用?C++ InlineFlowBox::borderLogicalLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineFlowBox
的用法示例。
在下文中一共展示了InlineFlowBox::borderLogicalLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computePositionedLogicalWidth
//.........这里部分代码省略.........
valueForLength(marginLogicalLeft, containerRelativeLogicalWidth);
marginLogicalRightAlias =
valueForLength(marginLogicalRight, containerRelativeLogicalWidth);
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth);
// Solve for 'left'
logicalLeftValue =
availableSpace -
(logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias);
} else if (logicalRight.isAuto()) {
marginLogicalLeftAlias =
valueForLength(marginLogicalLeft, containerRelativeLogicalWidth);
marginLogicalRightAlias =
valueForLength(marginLogicalRight, containerRelativeLogicalWidth);
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
// Solve for 'right'
logicalRightValue =
availableSpace -
(logicalLeftValue + marginLogicalLeftAlias + marginLogicalRightAlias);
} else if (marginLogicalLeft.isAuto()) {
marginLogicalRightAlias =
valueForLength(marginLogicalRight, containerRelativeLogicalWidth);
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth);
// Solve for 'margin-left'
marginLogicalLeftAlias =
availableSpace -
(logicalLeftValue + logicalRightValue + marginLogicalRightAlias);
} else if (marginLogicalRight.isAuto()) {
marginLogicalLeftAlias =
valueForLength(marginLogicalLeft, containerRelativeLogicalWidth);
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth);
// Solve for 'margin-right'
marginLogicalRightAlias =
availableSpace -
(logicalLeftValue + logicalRightValue + marginLogicalLeftAlias);
} else {
// Nothing is 'auto', just calculate the values.
marginLogicalLeftAlias =
valueForLength(marginLogicalLeft, containerRelativeLogicalWidth);
marginLogicalRightAlias =
valueForLength(marginLogicalRight, containerRelativeLogicalWidth);
logicalRightValue = valueForLength(logicalRight, containerLogicalWidth);
logicalLeftValue = valueForLength(logicalLeft, containerLogicalWidth);
// If the containing block is right-to-left, then push the left position as
// far to the right as possible
if (containerDirection == RTL) {
int totalLogicalWidth =
(computedValues.m_extent + logicalLeftValue + logicalRightValue +
marginLogicalLeftAlias + marginLogicalRightAlias)
.toInt();
logicalLeftValue =
containerLogicalWidth - (totalLogicalWidth - logicalLeftValue);
}
}
// ---------------------------------------------------------------------------
// 6. If at this point the values are over-constrained, ignore the value for
// either 'left' (in case the 'direction' property of the containing block
// is 'rtl') or 'right' (in case 'direction' is 'ltr') and solve for that
// value.
// ---------------------------------------------------------------------------
// NOTE: Constraints imposed by the width of the containing block and its
// content have already been accounted for above.
//
// FIXME: Deal with differing writing modes here. Our offset needs to be in
// the containing block's coordinate space, so that
// can make the result here rather complicated to compute.
//
// Use computed values to calculate the horizontal position.
//
// FIXME: This hack is needed to calculate the logical left position for a
// 'rtl' relatively positioned, inline containing block because right now, it
// is using the logical left position of the first line box when really it
// should use the last line box. When this is fixed elsewhere, this block
// should be removed.
if (containerBlock->isLayoutInline() &&
!containerBlock->style()->isLeftToRightDirection()) {
const LayoutInline* flow = toLayoutInline(containerBlock);
InlineFlowBox* firstLine = flow->firstLineBox();
InlineFlowBox* lastLine = flow->lastLineBox();
if (firstLine && lastLine && firstLine != lastLine) {
computedValues.m_position =
logicalLeftValue + marginLogicalLeftAlias +
lastLine->borderLogicalLeft() +
(lastLine->logicalLeft() - firstLine->logicalLeft());
return;
}
}
LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias;
computeLogicalLeftPositionedOffset(logicalLeftPos, this,
computedValues.m_extent, containerBlock,
containerLogicalWidth);
computedValues.m_position = logicalLeftPos;
}