Limit "Only retract when crossing perimeters" so that retraction is triggered also when crossing the boundaries of a single region. #2298