clipPath
The clipPath SVG element defines a clipping path, to be used by the clip-path property. A clipping path restricts the region to which paint can be applied.
Usually, this element is created with:
js
const clipPath = parentElement.add('clipPath')It's possible to create it as a disconnected element with gSVG('clipPath') and attach it to the SVG document with .attachTo().
.clipPathUnits()
js
clipPath.clipPathUnits( unit )Set the coordinate system for the contents of the clipPath element.
argument:
{string} unitMust be 'userSpaceOnUse' | 'objectBoundingBox'returns:
{gSVGObject}The original object
js
const clipPathUnits = element.clipPathUnits();Get the clipPathUnits current value.