ixfx
    Preparing search index...

    Function applyToPositions

    • Applies fn to both start and end fields, returning a new event.

      Existing data on event is maintained.

      applyToPosition( { start:1.2, end:2.4 }, v => Math.round(v)); // { start:1, end:2 }
      applyToPosition( { start:1, end:2 }, v => v*2); // { start:2, end:4 }

      Use translate if you just want to add an amount to start and end, instead of applying a custom function.

      Parameters

      • event: EventItem

        Input event

      • fn: (v: number) => number

        Function to run over start and end

      Returns EventItem

      New event with fn applied to start and end