RenderedOMeshRect constructor

RenderedOMeshRect({
  1. required OMeshRect mesh,
  2. required Rect rect,
  3. List<OVertex>? normalizedVerticesOverride,
})

Creates a new RenderedOMeshRect from a OMeshRect and a ui.Rect.

Implementation

RenderedOMeshRect({
  required this.mesh,
  required ui.Rect rect,
  List<OVertex>? normalizedVerticesOverride,
}) {
  final denormalizedVertices = (normalizedVerticesOverride ?? mesh.vertices)
      .map((ov) => ov.denormalize(rect))
      .toList();

  vertices = List.generate(
    denormalizedVertices.length,
    (index) => RenderedOVertex._fromVerticeOnMesh(
      index,
      mesh.width,
      denormalizedVertices,
    ),
  );
}