Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
AroriaNetwork
GitHub Repository: AroriaNetwork/3kho-backup
Path: blob/main/projects/n-gon/js/visibility.js
1834 views
1
const v={points:[],populate(){v.points=[{x:-150,y:-950},{x:710,y:-950},{x:710,y:-940},{x:710,y:-710},{x:710,y:-700},{x:-150,y:-700}]},draw(){ctx.beginPath(),ctx.moveTo(v.points[0].x,v.points[0].y);for(let t=0,o=v.points.length;t<o;t++)ctx.lineTo(v.points[t].x,v.points[t].y);ctx.globalCompositeOperation="destination-in",ctx.fill(),ctx.globalCompositeOperation="source-over",ctx.clip()}};v.populate();
2
3