Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

103
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda