mwg API
    Preparing search index...

    Function fitWindowZoom

    • The zoom a window stack should run at: base, stepped down a whole number at a time until contentHeight (unzoomed) fits viewportHeight, and never below 1. A tall window on a short screen would otherwise be clipped at both ends.

      Parameters

      • base: number
      • contentHeight: number
      • viewportHeight: number

      Returns number

      import { fitWindowZoom } from '@datamoc/mwg/two-d/ui';

      console.log(fitWindowZoom(3, 300, 700)); // 2 - 300 x 3 is too tall, 300 x 2 fits