fixed a bug that drawn shape protrudes from the appointed width (or height)