Add some objects alignment

Is there any rules should I need to follow?
This feature has some tiny problem:which is the object aligned to.