handling when height/width is smaller than the padding