Calculates the visible portion of the element inside the viewport