本文整理汇总了C++中Maybe::AvailableBSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Maybe::AvailableBSize方法的具体用法?C++ Maybe::AvailableBSize怎么用?C++ Maybe::AvailableBSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maybe
的用法示例。
在下文中一共展示了Maybe::AvailableBSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: captionSize
//.........这里部分代码省略.........
captionRI, innerBorderISize);
captionWM = captionRI->GetWritingMode();
} else {
NS_ASSERTION(captionSide == NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE ||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE,
"unexpected caption-side");
// Size the table and the caption independently.
captionWM = mCaptionFrames.FirstChild()->GetWritingMode();
OuterBeginReflowChild(aPresContext, mCaptionFrames.FirstChild(),
aOuterRI, captionRI,
aOuterRI.ComputedSize(captionWM).ISize(captionWM));
OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRI,
innerRI, aOuterRI.ComputedSize(wm).ISize(wm));
}
// First reflow the caption.
Maybe<ReflowOutput> captionMet;
LogicalSize captionSize(wm);
LogicalMargin captionMargin(wm);
if (mCaptionFrames.NotEmpty()) {
captionMet.emplace(wm);
nsReflowStatus capStatus; // don't let the caption cause incomplete
OuterDoReflowChild(aPresContext, mCaptionFrames.FirstChild(),
*captionRI, *captionMet, capStatus);
captionSize.ISize(wm) = captionMet->ISize(wm);
captionSize.BSize(wm) = captionMet->BSize(wm);
captionMargin =
captionRI->ComputedLogicalMargin().ConvertTo(wm, captionWM);
// Now that we know the bsize of the caption, reduce the available bsize
// for the table frame if we are bsize constrained and the caption is above
// or below the inner table. Also reduce the CB size that we store for
// our children in case we're a grid item, by the same amount.
LogicalSize* cbSize = Properties().Get(GridItemCBSizeProperty());
if (NS_UNCONSTRAINEDSIZE != aOuterRI.AvailableBSize() || cbSize) {
nscoord captionBSize = 0;
nscoord captionISize = 0;
switch (captionSide) {
case NS_STYLE_CAPTION_SIDE_TOP:
case NS_STYLE_CAPTION_SIDE_BOTTOM:
case NS_STYLE_CAPTION_SIDE_TOP_OUTSIDE:
case NS_STYLE_CAPTION_SIDE_BOTTOM_OUTSIDE:
captionBSize = captionSize.BSize(wm) + captionMargin.BStartEnd(wm);
break;
case NS_STYLE_CAPTION_SIDE_LEFT:
case NS_STYLE_CAPTION_SIDE_RIGHT:
captionISize = captionSize.ISize(wm) + captionMargin.IStartEnd(wm);
break;
}
if (NS_UNCONSTRAINEDSIZE != aOuterRI.AvailableBSize()) {
innerRI->AvailableBSize() =
std::max(0, innerRI->AvailableBSize() - captionBSize);
}
if (cbSize) {
// Shrink the CB size by the size reserved for the caption.
LogicalSize oldCBSize = *cbSize;
cbSize->ISize(wm) = std::max(0, cbSize->ISize(wm) - captionISize);
cbSize->BSize(wm) = std::max(0, cbSize->BSize(wm) - captionBSize);
if (oldCBSize != *cbSize) {
// Reset the inner table's ReflowInput to stretch it to the new size.
innerRI.reset();
OuterBeginReflowChild(aPresContext, InnerTableFrame(), aOuterRI,
innerRI, aOuterRI.ComputedSize(wm).ISize(wm));
}
}
}
}