displayRectToViewport

fun displayRectToViewport(pageIndex: Int, rect: KiteRectangle): Rect?(source)

hitTestDisplay run backwards for a rectangle: rect, in the display space of the page pageIndex, to the viewport pixels it is painted at under the current zoom and pan. Null while that page has no place in the layout: a paged layout places only its current page.

It reads snapshot state, so an element placed with it in the viewer's overlay follows the page as it scrolls and zooms, and keeps its own size. To draw at the page's scale instead, use the viewer's pageOverlay (#30).