本文整理汇总了C++中AffineTransform::mapQuad方法的典型用法代码示例。如果您正苦于以下问题:C++ AffineTransform::mapQuad方法的具体用法?C++ AffineTransform::mapQuad怎么用?C++ AffineTransform::mapQuad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AffineTransform
的用法示例。
在下文中一共展示了AffineTransform::mapQuad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nodeAtPoint
bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit, LayoutUnit, HitTestAction)
{
// FIXME: integrate with InlineTextBox::nodeAtPoint better.
ASSERT(!isLineBreak());
PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_TEXT_HITTESTING, request, renderer().style().pointerEvents());
bool isVisible = renderer().style().visibility() == VISIBLE;
if (isVisible || !hitRules.requireVisible) {
if ((hitRules.canHitStroke && (renderer().style().svgStyle().hasStroke() || !hitRules.requireStroke))
|| (hitRules.canHitFill && (renderer().style().svgStyle().hasFill() || !hitRules.requireFill))) {
FloatPoint boxOrigin(x(), y());
boxOrigin.moveBy(accumulatedOffset);
FloatRect rect(boxOrigin, size());
if (locationInContainer.intersects(rect)) {
float scalingFactor = renderer().scalingFactor();
ASSERT(scalingFactor);
float baseline = renderer().scaledFont().fontMetrics().floatAscent() / scalingFactor;
AffineTransform fragmentTransform;
for (auto& fragment : m_textFragments) {
FloatQuad fragmentQuad(FloatRect(fragment.x, fragment.y - baseline, fragment.width, fragment.height));
fragment.buildFragmentTransform(fragmentTransform);
if (!fragmentTransform.isIdentity())
fragmentQuad = fragmentTransform.mapQuad(fragmentQuad);
if (fragmentQuad.containsPoint(locationInContainer.point())) {
renderer().updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset));
if (!result.addNodeToRectBasedTestResult(&renderer().textNode(), request, locationInContainer, rect))
return true;
}
}
}
}
}
return false;
}