width and height are 0 when the window is minimized. this leads to a division by zero in the perspective calculation