Corrected newwindowsize so it takes X/Y origin into account when calculating X/Y Max