parametrized left/top calculation