Here's an example using: <circle>
<svg viewBox="-20 -20 150 150" xmlns="http://www.w3.org/2000/svg">
<clipPath id="myClip" clipPathUnits="objectBoundingBox">
<circle cx=".5" cy=".5" r=".5" />
</clipPath>
<rect x="0" width="100" height="100" rx="15" clip-path="url(#myClip)" />
</svg>
Trying the same approach with <line>
- it doesn't seem to work
<svg viewBox="-20 -20 150 150" xmlns="http://www.w3.org/2000/svg">
<clipPath id="myClip" clipPathUnits="objectBoundingBox">
<line x1="0" y1="0" x2="1" y2="1" />
</clipPath>
<rect x="0" width="100" height="100" rx="15" clip-path="url(#myClip)" />
</svg>
Expected to see part of the rectangle, but nothing is showing up
It appears that <line>
cannot be used within a <clipPath>