Bug fix: Adjusted viewport intersection to use the right coordinate system, with origo in the bottom-left corner and with the y-axis pointing upwards.