本文整理汇总了C++中SVGMaskElement::maskContentUnits方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGMaskElement::maskContentUnits方法的具体用法?C++ SVGMaskElement::maskContentUnits怎么用?C++ SVGMaskElement::maskContentUnits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGMaskElement
的用法示例。
在下文中一共展示了SVGMaskElement::maskContentUnits方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resourceBoundingBox
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
// Save the reference to the calling object for relayouting it on changing resource properties.
if (!m_masker.contains(object))
m_masker.set(object, new MaskerData);
// Resource was not layouted yet. Give back clipping rect of the mask.
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = maskElement->maskBoundingBox(objectBoundingBox);
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskBoundaries.isEmpty())
calculateMaskContentRepaintRect();
if (!maskElement)
return FloatRect();
FloatRect maskRect = m_maskBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例2: resourceBoundingBox
FloatRect LayoutSVGResourceMasker::resourceBoundingBox(const LayoutObject* object)
{
SVGMaskElement* maskElement = toSVGMaskElement(element());
ASSERT(maskElement);
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = SVGLengthContext::resolveRectangle<SVGMaskElement>(maskElement, maskElement->maskUnits()->currentValue()->enumValue(), objectBoundingBox);
// Resource was not layouted yet. Give back clipping rect of the mask.
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskContentBoundaries.isEmpty())
calculateMaskContentPaintInvalidationRect();
FloatRect maskRect = m_maskContentBoundaries;
if (maskElement->maskContentUnits()->currentValue()->value() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例3: resourceBoundingBox
FloatRect RenderSVGResourceMasker::resourceBoundingBox(RenderObject* object)
{
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
ASSERT(maskElement);
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect maskBoundaries = maskElement->maskBoundingBox(objectBoundingBox);
// Resource was not layouted yet. Give back clipping rect of the mask.
if (selfNeedsLayout())
return maskBoundaries;
if (m_maskContentBoundaries.isEmpty())
calculateMaskContentRepaintRect();
FloatRect maskRect = m_maskContentBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskBoundaries);
return maskRect;
}
示例4: resourceBoundingBox
FloatRect RenderSVGResourceMasker::resourceBoundingBox(const FloatRect& objectBoundingBox)
{
if (m_maskBoundaries.isEmpty())
calculateMaskContentRepaintRect();
SVGMaskElement* maskElement = static_cast<SVGMaskElement*>(node());
if (!maskElement)
return FloatRect();
FloatRect maskRect = m_maskBoundaries;
if (maskElement->maskContentUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
AffineTransform transform;
transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
maskRect = transform.mapRect(maskRect);
}
maskRect.intersect(maskElement->maskBoundingBox(objectBoundingBox));
return maskRect;
}