Added method to convert between window and cell coordinates