update rect.dist