本文整理汇总了C++中PaintLayer::getScrollableArea方法的典型用法代码示例。如果您正苦于以下问题:C++ PaintLayer::getScrollableArea方法的具体用法?C++ PaintLayer::getScrollableArea怎么用?C++ PaintLayer::getScrollableArea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaintLayer
的用法示例。
在下文中一共展示了PaintLayer::getScrollableArea方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateScrollTranslation
void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& object, PaintPropertyTreeBuilderContext& context)
{
if (!object.isBoxModelObject() || !object.hasOverflowClip())
return;
PaintLayer* layer = toLayoutBoxModelObject(object).layer();
ASSERT(layer);
DoubleSize scrollOffset = layer->getScrollableArea()->scrollOffset();
if (scrollOffset.isZero() && !layer->scrollsOverflow())
return;
RefPtr<TransformPaintPropertyNode> scrollTranslation = TransformPaintPropertyNode::create(
TransformationMatrix().translate(-scrollOffset.width(), -scrollOffset.height()),
FloatPoint3D(),
context.currentTransform);
context.currentTransform = scrollTranslation.get();
object.getMutableForPainting().ensureObjectPaintProperties().setScrollTranslation(scrollTranslation.release());
}
示例2: clear
void ScrollAnchor::clear() {
LayoutObject* layoutObject =
m_anchorObject ? m_anchorObject : scrollerLayoutBox(m_scroller);
PaintLayer* layer = nullptr;
if (LayoutObject* parent = layoutObject->parent())
layer = parent->enclosingLayer();
// Walk up the layer tree to clear any scroll anchors.
while (layer) {
if (PaintLayerScrollableArea* scrollableArea = layer->getScrollableArea()) {
ScrollAnchor* anchor = scrollableArea->scrollAnchor();
DCHECK(anchor);
anchor->clearSelf();
}
layer = layer->parent();
}
if (FrameView* view = layoutObject->frameView()) {
ScrollAnchor* anchor = view->scrollAnchor();
DCHECK(anchor);
anchor->clearSelf();
}
}