getFirstOffsetAfter<T> method

double getFirstOffsetAfter<T>(
  1. double offset
)

Finds the first snapping offset greater than or equal to the given offset.

  • offset: The current offset of the sheet.
  • Returns: The closest snapping offset above or equal to the given offset.

Implementation

double getFirstOffsetAfter<T>(double offset) =>
    snappingPixelOffsets.firstWhere(
      (snapOffset) => snapOffset.roundDecimal() >= offset.roundDecimal(),
      orElse: () => snappingPixelOffsets.lastOrNull ?? 0.0,
    );