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

109
Views
Fabric JS get relative cordinates of mouse click in zoomed view

I am using fabric JS 4.5 and need to capture mouse click. The mouse click cordinates could change based on canvas resize or zoom . I was able to handle the resize issue but stuck in zoom.

Assume that I click on canvas at point (x1,y1) at zoom level 1. Now when I zoom , the same point would now be at (x2, y2) . I wanted to convert (x2, y2) to (x1, y1) . What fabric utils / functions could I use ? In other words if I know the zoom level and clicked point, I need to convert that point to a space where the the canvas would be at default zoom( which is 1 ) . We can assume that canvas width and height is a constant ( have already solved dynamic sizes ) . This convertion is not to render that point , but send it to an API

Referred to the documentation, transformation matrices and several questions but was unable to find this and my vecor background is not strong.

Explored the getPointer and ignoreZoom functionality but that didn't work:

 this.canvas.getPointer(event.e, true)
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!