translate/translate3d logic