Thanks very much.
I forgot to make a comment (the day before this comment) that I found a solution that fits my game.
But yours works much better and has much less code. I could not have done that myself.
My solution
- works when making the aspect ratio taller, but not wider.
- loses precision the taller the aspect ratio becomes.
Your solution has none of these downsides.
Now I have to clean up the code by moving the position calibration logic into its own node,
since in good programming, no code should be repeated.
But this state is much better than having to write the logic from scratch without knowing where to begin.