update top/left calculations