Fixed issue with viewX and viewY not being reset.