Canvas: Clipping, Masking, Pattern
Clipping:
var clipInstance = renderer_.createClip();
clipInstance.clip.createEl({
el: 'polygon',
attr:{
points: [{x: 0, y: 0}, {x: 0, y: 100}, {x: 100, y: 100}, {x: 100, y: 0}, {x: 0, y: 0}]
}
});g.createEl({
el: 'circle',
attr: {
cx: 100,
cy: 100,
r: 100
},
style: {
'clip-Path': clipInstance,
strokeStyle: 'grey',
fillStyle: 'green'
}
});Masking:
Pattern:
Last updated