Unable to draw correctly on canvas after zooming in/out ( Scaling)
问题 I am unable to draw correctly after scaling. The aim is to allow users to draw rectangles on the image. I am using canvas to display the image and then draw rectangles on image, this is working fine. But now I am trying to add zoom in and zoom out functionality. I need to move the rectangle after zooming in/out , I am able to do so correctly. I have 3 arrays where I am saving the rectangle coordinates: drawItems : Initial rectangle coordinates on draw currentItems : Coordinates after scaling