Fabricjs: fill svg with image pattern
问题 I’d like to load my SVG file, and fill it with pattern, created from my image file. Here is my current approach: canvas = new fabric.Canvas('mainCanvas') # image = new fabric.Image(img[0]) # console.log image fabric.loadSVGFromURL '/assets/my.svg', (objects) -> fabric.util.loadImage "url/to/my/image", (image) -> console.log image svg = fabric.util.groupSVGElements(objects) svg = svg.scale(0.04).set(fill: "black", opacity: 0.5 ) svg.fill = new fabric.Pattern source: image repeat: "no-repeat"