Added missing offset calculations.

I added the offset calculations for positioning BOTTOM and RIGHT.