Only set height/width if it's a non-negative number (don't set it to 0).