fix resize when heith or width is 0