Converts global coordinates to widnow local coordinates.
The global value in the box x is translated to a local x-value and put back into x. Similarly, the global value in y is changed to a local y-value.