ixfx
    Preparing search index...

    Function divideInternal

    • Divides positioned rect by width/height. Useful for normalising a value. x & y value of second parameter are ignored

      // Normalise based on window size
      const r = { x: 10, y: 200, width: 100, height: 30 };
      const rr = Rects.divide(r, window.innerWidth, window.innerHeight);

      Division applies to the first parameter's x/y fields. X is affected by width, Y is affected by height.

      Parameters

      Returns RectPositioned

    • Divides rect by width/height. Useful for denormalising a value.

      // Normalise based on window size
      const r = { width: 100, height: 30 };
      const rr = Rects.divide(r, window.innerWidth, window.innerHeight);

      Parameters

      • rect: Rect
      • width: number
      • height: number

      Returns Rect

    • Divides positioned rect a by width and height of rect b.

      // Returns { ...a, width: a.width / b.width, height: a.height/b.height, x: a.x / b.width, y: a.y / b.height }
      Rects.divide(a, b);

      Returns RectPositioned

    • Divides rect a by width and height of rect b.

      // Returns {...a, width: a.width / b.width, height: a.height/b.height }
      Rects.divide(a, b);

      Parameters

      Returns Rect