Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

104
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda