Hi all,
Just filing a report here. I'm not able to add a shadow using the .setShadow object method. Any ideas whats going on? My app is pretty complex and all the other methods work fine. It's just this.
4.0.0-beta.8
Which browsers?
Firefox 74.0 (64-bit)
// Create the new templateRect
var templateRect = new fabric.Rect({
originX: "left",
originY: "top",
left: originX,
top: originY,
width: templateWidth,
height: templateHeight,
fill: "#fff" /* use transparent for no fill */,
// strokeDashArray: [10, 10],
stroke: "black",
selectable: false,
strokeWidth: 1,
});
templateRect.setShadow({
color: "red",
blur: 10,
offsetX: 20,
offsetY: 20,
});
// Add the templateRect to the canvas
canvas.add(templateRect);
canvas.renderAll();
Add a shadow to a Rect
TypeError: templateRect.setShadow is not a function
The setShadow() method was removed as of v4.0.0-beta.7 (see below). Use rect.set('shadow', new fabric.Shadow(options)) instead.
https://github.com/fabricjs/fabric.js/releases/tag/v4.0.0-beta.7
Thank you man!
Most helpful comment
The
setShadow()method was removed as of v4.0.0-beta.7 (see below). Userect.set('shadow', new fabric.Shadow(options))instead.https://github.com/fabricjs/fabric.js/releases/tag/v4.0.0-beta.7