setSegment method

void setSegment(
  1. {required int segmentIndex,
  2. required Segment segment}
)

Replaces a segment at the specified index in the part.

The points of the part can change if the input segment is not coincident with the start and end points of the segment that's being replaced.

Parameters:

  • segmentIndex — Zero-based index of the segment.
  • segment — The segment to be set into the collection.

Implementation

void setSegment({required int segmentIndex, required Segment segment}) {
  _withThrowingErrorHandler((errorHandler) {
    runtimecore.RT_MutablePart_setSegment(
        _handle, segmentIndex, segment._handle, errorHandler);
  });
}