[X] I have searched and referenced existing issues, feature requests and discussions
[X] I am filing a FEATURE request.
Description
I am adding a shadow to a rect with a border on a canvas using the following code.
setBasicShadow(color, blur, x, y, isButton: boolean = false, valueType, keyName, KeyType, isSlider: boolean = false) { console.log(color,blur,x,y); this.shadowType = '8'; this.props.shadowColor = color; this.canvas.getActiveObject().set({ shadow: { affectStroke: false, color: color, blur: blur, offsetX: x, offsetY: y } }); this.canvas.getActiveObject().set({ objectCaching: true, statefullCache: true }) this.canvas.renderAll(); }
Now clone object and add on canvas :
`activeObject.clone(cloned => {
clone = cloned;
clone.set({
objectCaching: false
})
});`
Using above code shadow not showing to cloned Object.
Using below code , shadow is showing but on rect fill area.
CheckList
Description
I am adding a shadow to a rect with a border on a canvas using the following code.
setBasicShadow(color, blur, x, y, isButton: boolean = false, valueType, keyName, KeyType, isSlider: boolean = false) { console.log(color,blur,x,y); this.shadowType = '8'; this.props.shadowColor = color; this.canvas.getActiveObject().set({ shadow: { affectStroke: false, color: color, blur: blur, offsetX: x, offsetY: y } }); this.canvas.getActiveObject().set({ objectCaching: true, statefullCache: true }) this.canvas.renderAll(); }
}) });`
Using above code shadow not showing to cloned Object.
Using below code , shadow is showing but on rect fill area.
activeObject.clone(cloned => { clone = cloned; clone.set({ objectCaching: false, shadow: new latestFabric.fabric.Shadow({ color: activeObject.shadow.color, blur: activeObject.shadow.blur, offsetX: activeObject.shadow.offsetX, offsetY: activeObject.shadow.offsetY, affectStroke: true, }) }) });
Current State
Shadow bring on rect, not behind it.
cloned object should same as original Object.
Additional Context
No response