Calculate coordinates when the transform origin changes

This is not a purely Ionic issue but I’m dealing with a problem that my non mathematical mind can not solve by itself. :stuck_out_tongue:

I have an app that let the user make souvenirs and they can take a ‘selfie’ and then with this photo they can translate, drag and pinch to zoom the image to position it. If the scale is 1, the translate coordinates at the time to create the canvas with the two joined images works fine but if the user scale up/down the transform origin changes and the translate coordinates are no the same as with scale 1.

Is there a way to calculate this changes? The default transform origin is 50% 50%.