Is it possible to make a SVG clipPath with a responsive?

后端 未结 1 537
[愿得一人]
[愿得一人] 2021-01-13 22:17

I am trying to make a responsive SVG with a bitmap pattern and a sort of complex shape with clipPath.

If I use a instead of a <

相关标签:
1条回答
  • 2021-01-13 22:55

    Convert your <clipPath> to use clipPathUnits="objectBoundingBox". When using objectBoundingBox units, your clip path coords map to the bounding box of the element they are being applied to. (0,0) maps to the top left of the element. (1,1) maps to the bottom right.

    You'll need to redefine your path (or apply a transform to convert the coords to this range). But once you do, it will automatically scale to fit whatever you apply it to.

    0 讨论(0)
提交回复
热议问题