weasel API - v0.8.0
    Preparing search index...

    Interface FitViewToBoundsOptions

    Options for fitViewToBounds.

    interface FitViewToBoundsOptions {
        maxScale?: number;
        minScale?: number;
        mode?: "fill" | "contain" | "stretch";
        padding?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    maxScale?: number

    Override the kit's system max scale. Defaults to the kit-wide max zoom used by computeWheelAction / useZoom (currently 10).

    minScale?: number

    Override the kit's system min scale. Defaults to the kit-wide min zoom used by computeWheelAction / useZoom (currently 0.1).

    mode?: "fill" | "contain" | "stretch"

    Fit mode:

    • 'contain' (default): uniform scale = min(availW/w, availH/h). Bounds fit entirely; one axis has letterboxing.
    • 'fill': uniform scale = max(...). Bounds overflow viewport on one axis.
    • 'stretch': per-axis scale. Bounds match viewport exactly; scale is non-uniform.
    padding?: number

    Inset (in CSS px) around the bounds. Default 16.