KitePageOverlayScope

@Stable
interface KitePageOverlayScope(source)

What the pageOverlay of KiteDocView draws in: one page, in the page's own frame. The frame moves and scales with the page, so an element placed on a rectangle of the page stays on that rectangle at any zoom, and grows with the page (#30).

An element with neither displayRect nor pageRect sits at the top-left corner of the page, measured to fit inside the page.

Properties

Link copied to clipboard
abstract val page: KitePage

The page under the overlay.

Link copied to clipboard
abstract val pageIndex: Int

The index of the page, as KiteDocViewState.currentPage and KitePageHit.pageIndex count it.

Functions

Link copied to clipboard
abstract fun Modifier.displayRect(rect: KiteRectangle): Modifier

Sizes the element to rect and places it there. rect is in the display space of the page: the space of KiteDocViewState.hitTestDisplay, of search hits, and of the links and media elements of an EPUB page.

Link copied to clipboard
open fun followLink(href: String, rect: KiteRectangle): Boolean

Follows a link that an element of the overlay opens, such as a link in a web view over an embedded document (#41), as a tap on a link of the page does: the onLinkTap of KiteDocView sees it first, and when that does not take it, a link inside the document moves the view to its target. href is a link as the page gives its own: on an EPUB page, a zip path with a fragment, as EpubLink.href is, or an address with a scheme. rect is the area of the link in display space. Call it on the main thread.

Link copied to clipboard
abstract fun Modifier.pageRect(rect: KiteRectangle): Modifier

Sizes the element to rect and places it there. rect is in the page's own space: the space of KiteDocViewState.hitTest and of the rectangle of a PDF annotation.