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

    Function fitZoom

    • Compute the largest uniform zoom (px per content-unit) that fits a content rect of contentW x contentH (in content units) into a viewport rect of availW x availH (in pixels).

      clamp optionally bounds the resulting zoom to [min, max].

      Parameters

      • availW: number
      • availH: number
      • contentW: number
      • contentH: number
      • Optionalclamp: { max?: number; min?: number }

      Returns number