SHARE
TWEET

Untitled

a guest Aug 24th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var canvas = new fabric.Canvas('canvas')
  2.  
  3. var rect = new fabric.Rect({
  4.   width: 100,
  5.   height:100,
  6.   fill: 'red',
  7.   left: 100,
  8.   top: 100
  9. });
  10.  
  11. canvas.add(rect)
  12.  
  13. var clipGroup = new fabric.Group([
  14.  new fabric.Circle({
  15.     radius: 50,
  16.     left: -50,
  17.     top: -50
  18.   }),
  19.   new fabric.Rect({
  20.     width: 25,
  21.     height: 25,
  22.     left: 0,
  23.     top: 0,
  24.     globalCompositeOperation: 'destination-out'
  25.   })
  26. ]);
  27.  
  28. rect.clipPath = clipGroup;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top