GraphicsStack

class GraphicsStack(initial: GraphicsState = GraphicsState(), maxDepth: Int = 4096)

Mutable stack façade. Holds the current state plus a save stack for q/Q.

Callers update via the typed mutators (replaceCtm, setFillColor, etc.) or read the current state directly. The stack is bounded by maxDepth, the limit MuPDF uses, to defend against PDFs that q-spam without Q. Past it a save pushes nothing and its matching restore pops nothing, so restores keep pairing with their saves (ISO 32000-1, 8.4.4) instead of each one consuming a real frame (#49).

Constructors

Link copied to clipboard
constructor(initial: GraphicsState = GraphicsState(), maxDepth: Int = 4096)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun mutateText(block: (TextState) -> TextState)
Link copied to clipboard
Link copied to clipboard
fun restore()
Link copied to clipboard
fun save()