Implemented functions for converting between graph and window coordinates