Returns a rect that is attached to button on the left or right
Returns a rect that is attached to button on the top or bottom alignment preference chooses where a resulting rect should connect If pref is min, then result.x == button.x If pref is max, then result.endx == button.endx