fixed osx to resize and pad properly.