How Selection Acts on Chromosomal Inversions