本文整理汇总了C++中Maybe::ClipContainingBlockDescendants方法的典型用法代码示例。如果您正苦于以下问题:C++ Maybe::ClipContainingBlockDescendants方法的具体用法?C++ Maybe::ClipContainingBlockDescendants怎么用?C++ Maybe::ClipContainingBlockDescendants使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maybe
的用法示例。
在下文中一共展示了Maybe::ClipContainingBlockDescendants方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rect
void
nsHTMLButtonControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// Clip to our border area for event hit testing.
Maybe<DisplayListClipState::AutoSaveRestore> eventClipState;
const bool isForEventDelivery = aBuilder->IsForEventDelivery();
if (isForEventDelivery) {
eventClipState.emplace(aBuilder);
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
nscoord radii[8];
bool hasRadii = GetBorderRadii(radii);
eventClipState->ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
nsDisplayList onTop;
if (IsVisibleForPainting(aBuilder)) {
mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
}
nsDisplayListCollection set;
// Do not allow the child subtree to receive events.
if (!isForEventDelivery) {
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
if (IsInput() || StyleDisplay()->mOverflowX != NS_STYLE_OVERFLOW_VISIBLE) {
nsMargin border = StyleBorder()->GetComputedBorder();
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
bool hasRadii = GetPaddingBoxBorderRadii(radii);
clipState.ClipContainingBlockDescendants(rect, hasRadii ? radii : nullptr);
}
BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aDirtyRect, set,
DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT);
// That should put the display items in set.Content()
}
// Put the foreground outline and focus rects on top of the children
set.Content()->AppendToTop(&onTop);
set.MoveTo(aLists);
DisplayOutline(aBuilder, aLists);
// to draw border when selected in editor
DisplaySelectionOverlay(aBuilder, aLists.Content());
}