Fixed distortions caused when resizing window