Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
Converting "Arc" shape code to Fabric.js 521

I'm trying to convert our legacy code, that uses Fabric.js 4.0.0-beta.6, to the latest version but encountered a problem I can't seem to resolve.

I'm trying to draw an arc shape which is going fine in version 4 but doesn't work in later versions.

https://jsbin.com/rigusotuto/edit?html,js,output

const canvas = new fabric.Canvas('canvas');
canvas.setWidth(document.body.clientWidth);
canvas.setHeight(document.body.clientHeight);

const angle = 100;
const radius = 100;

const arc = new fabric.Circle({
  originX: 'center',
  originY: 'center',
  radius: radius,
  fill: 'rgba(0,0,0,0.8)',
  left: 100,
  top: 100,
  clipTo: (ctx) => {
    ctx.moveTo(0, 0);
    ctx.arc(
      0,
      0,
      radius,
      (360 - angle) * (Math.PI / 180) - Math.PI / 2, 
      360 * (Math.PI / 180) - Math.PI / 2,
      false
    );
    },
});

canvas.add(arc);
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!