Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var canvas = new fabric.Canvas('canvas')
- var rect = new fabric.Rect({
- width: 100,
- height:100,
- fill: 'red',
- left: 100,
- top: 100
- });
- canvas.add(rect)
- var clipGroup = new fabric.Group([
- new fabric.Circle({
- radius: 50,
- left: -50,
- top: -50
- }),
- new fabric.Rect({
- width: 25,
- height: 25,
- left: 0,
- top: 0,
- globalCompositeOperation: 'destination-out'
- })
- ]);
- rect.clipPath = clipGroup;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement