本文整理汇总了C++中HitTestRequest类的典型用法代码示例。如果您正苦于以下问题:C++ HitTestRequest类的具体用法?C++ HitTestRequest怎么用?C++ HitTestRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HitTestRequest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNodeToRectBasedTestResult
bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestRequest& request, const HitTestLocation& locationInContainer, const FloatRect& rect)
{
// If it is not a rect-based hit test, this method has to be no-op.
// Return false, so the hit test stops.
if (!isRectBasedTest())
return false;
// If node is null, return true so the hit test can continue.
if (!node)
return true;
if (!request.allowsShadowContent())
node = node->deprecatedShadowAncestorNode();
mutableRectBasedTestResult().add(node);
bool regionFilled = rect.contains(locationInContainer.boundingBox());
return !regionFilled;
}
示例2: nodeAtFloatPointInternal
bool LayoutSVGShape::nodeAtFloatPointInternal(const HitTestRequest& request,
const FloatPoint& localPoint,
PointerEventsHitRules hitRules) {
bool isVisible = (style()->visibility() == EVisibility::Visible);
if (isVisible || !hitRules.requireVisible) {
const SVGComputedStyle& svgStyle = style()->svgStyle();
WindRule fillRule = svgStyle.fillRule();
if (request.svgClipContent())
fillRule = svgStyle.clipRule();
if ((hitRules.canHitBoundingBox &&
objectBoundingBox().contains(localPoint)) ||
(hitRules.canHitStroke &&
(svgStyle.hasStroke() || !hitRules.requireStroke) &&
strokeContains(localPoint, hitRules.requireStroke)) ||
(hitRules.canHitFill && (svgStyle.hasFill() || !hitRules.requireFill) &&
fillContains(localPoint, hitRules.requireFill, fillRule)))
return true;
}
return false;
}