Fixed a bug which sometimes occured on touch devices.
The bug would prevent the viewport from properly changing size.