added function to convert GraphicsView coordinates into box coordinates