Make selection background rectangular over selection

This makes the backgrounds of selections rectangular over the whole selection for both static and editable math.