如何使用 rapaheljs 使用 rect
元素来裁剪内容?我通过手动创建元素来实现这一点。我创建的标记如下所示,现在我想用 raphaeljs 来完成。
<clipPath id="clipper">
<rect x="0" y="0" height="160" width="250"/>
</clipPath>
<g clip-path="url(#clipper)">
...
...
</g>
或者是否有任何其他方法使用 rapaheljs 创建像这样的裁剪矩形? 任何帮助,将不胜感激。谢谢。
最佳答案
在拉斐尔那里是这样的:
elm.attr({clip-rect: "0 0 160 160"})
...其中 elm 是您示例中的
关于javascript - 如何在 raphaeljs 中使用 rect 元素剪辑内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9513587/