implements centering on resize

removes many window size calculations (100% is enough)