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

    Interface View

    Viewport state. (view.x, view.y) is the world point currently rendered at the canvas top-left; view.scale.x / view.scale.y is pixels per world unit on each axis (default { x: 1, y: 1 }). So:

    screenX = (worldX - view.x) * view.scale.x screenY = (worldY - view.y) * view.scale.y worldX = screenX / view.scale.x + view.x worldY = screenY / view.scale.y + view.y

    scale is always a 2-vector. Input convenience types ZoomFactor and ZoomBound let callers pass a scalar when they want both axes treated the same.

    interface View {
        scale: { x: number; y: number };
        x: number;
        y: number;
    }
    Index

    Properties

    Properties

    scale: { x: number; y: number }
    x: number
    y: number