ixfx
    Preparing search index...

    Function normaliseByRect

    • Normalises start and end points by given width and height. Useful for converting an absolutely-defined line to a relative one.


      // Line 1,1 -> 10,10
      const l = Lines.fromNumbers(1,1,10,10);
      const ll = Lines.normaliseByRect(l, 10, 10);
      // Yields: 0.1,0.1 -> 1,1

      Parameters

      • line: Line
      • width: number
      • height: number

      Returns Line