Updated MainView to fix bug in window resizing; was using document instead of window.