Calculate mouse position after zoom ?

Calculate mouse position after zoom ?

Hi I'm using a jQuery plugin to create a flowchart, this allows you to create links between connectors. This all works well but I've needed the ability to zoom on the flowchart, so I've used jQuery UI animate zoom and that seems to work fine.

When I click on a flowchart connector a temp link is generated that follows the mouse pointer until you click the final connector and the link is made..

Currently the temp link is not in line with the mouse pointer when a zoom is applied. It appears that when the zoom rate is anything other than 1 the X and Y position of the mouse pointer change so the temp link isn't right.

This is the flowchart I'm using https://github.com/sdrdis/jquery.flowchart and the zoom is applied using $('#grid').animate({ 'zoom': currentZoom += .1 }, 'slow');

How do I calculate the correct X and Y position when a positive or negative zoom is applied ?

Thanks