calculating getTop() and getHeight()