Evolution of dispersal and mating systems along geographic gradients: implications for shifting ranges