rulus.ui.offset: calculate offset