Don't allow rectangular area to be equal to zero, don't let rectangular go out of canvas