Fixed a bug that caused the window size to be incorrect due to dragging the window during resize.